LaunchDarkly
Send LaunchDarkly feature flag change events to Last9 and visualize them as annotations in Last9's Alert Details and managed Grafana
Last9 Last9’s integration with LaunchDarkly enables change intelligence with feature flag events. Visualize the feature flag events as Change Event annotations in Last9 to correlate system health.
Prerequisites
To start sending feature flag events to Last9 Change Events, you’ll need:
- Last9 account, and create a Last9 cluster by following Getting Started
- Last9 API write token / (docs)
- A default Change Events cluster / (docs)
Set up the Last9 integration in the LaunchDarkly dashboard
-
Navigate to the LaunchDarkly Integrations page and find “Last9”
-
Click on “Add Integration” to view the “Create Last9 configuration” side panel
-
(Optional) Provide a Name to the integration that’s human-readable and easy to identify, especially if this instance of the integration is scoped to certain policy filters
-
Enter the Last9 API’s base URL. Do not include a trailing
/
. For thehttps://{host}/api/v4/organizations/{org}
format, useapp.last9.io
as the{host}
and you can use your organization slug from the Last9 dashboard URL (thedemo
in app.last9.io/v2/organizations/demo/apps) as the{org}
-
Enter the Last9 API write refresh token. If you have not saved the write token earlier while generating it, you can click on “Generate Tokens” on the API Access page in the Last9 dashboard to get a new write refresh token
-
(Optional) Provide a Last9 tag. If provided, all feature flag events matching the policy filter (defined in the next step) will be only associated with Last9 entities with the same tag. This is particularly helpful if this instance of the integration is scoped to certain LaunchDarkly policy filters
-
(Optional) Configure a custom LaunchDarkly policy to control which events LaunchDarkly sends to Last9
-
Once you’ve read the Integration Terms and Conditions, click on the “I have read and agree to the Integration Terms and Conditions” checkbox
-
Click on “Save Configuration”. This new integration now appears on the Integrations page under Last9. It is switched on by default
-
Last9 will now start receiving relevant change events whenever a feature flag event is triggered
-
To verify if the integration is working as expected:
- Click on the
...
icon next to the newly created integration and click on “Edit Integration Configuration” - Click on “Validate Connection”. This will trigger a test event from LaunchDarkly
- To view the test event in Last9, visit Grafana
- Run a query against the
last9_change_events{}
metric to visualize it on the chart - You’ll see a data point on which you can hover to see the test event’s labels
- Click on the
Visualize LaunchDarkly events as Annotations in Last9’s managed Grafana
- Open any Dashboard → Settings → Annotations
- Click on “Add Annotation Query”
- Give it a name, eg: LaunchDarkly All Events
- Select the “Data source” to be the same as the default cluster set in the Change Events settings
- In “Query”, expand the “Metrics browser”, and select the
last9_change_events
metric - Optionally, you can select one more label and their values if you want to filter the visualized annotations. For eg, selecting
environment_key
andevent_state
labels followed byproduction
andstart
values respectively. Only start annotations of the production environment will be visualized - Click on “Use query” to construct the final query
- Give an appropriate name to be visualized while viewing the annotation. For eg, “Event on {{environment_key}} started” will result in “Event on production started”
- Click on “Apply” to save the configuration. You can also click on “Preview in dashboard” to save and preview
- Do remember to click on “Save dashboard” to persist the new annotation
Visualize LaunchDarkly events as Annotations in Last9’s Alert Details modal
- Click on an alert to view the Alert Details modal
- You can receive the alert as a notification in Slack or another tool of choice
- You can click on an alert while viewing Alert Monitor
- You can click on an alert while viewing an Alert Group’s Health tab
- While viewing the Alert Details modal, click on an “Impacted Label”
- If there are any associated Change Events:
- You‘ll see “x events for selected label”
- You‘ll see a purple annotation on the chart with a timestamp
- Hovering on the annotation will let you view details of the change event
Note:
- While Change Events can be sent to any data source while using Last9’s Change Events API, in case of the LaunchDarkly integration, all feature flag events are sent only to the default cluster selected in the Change Events settings in the Last9 dashboard
- Change Events are only visualized when an Alert Group’s data source is the same as well. In the case of the LaunchDarkly integration, the Alert Group’s data source should be the same as the default cluster selected in the Change Event settings
Troubleshooting
Please get in touch with us on Discord or Email if you have any questions.