Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support id lookup on slo timeseries dashboard widgets #312

Merged
merged 13 commits into from
May 14, 2024

Conversation

smo921
Copy link
Contributor

@smo921 smo921 commented May 13, 2024

Support fetching SLO ID from Kennel ID in dashboard timeseries widgets.

Example relevant Datadog timeseries widget JSON:

            "definition": {
                "title": "Widget Title",
                "title_size": "16",
                "title_align": "left",
                "show_legend": false,
                "type": "timeseries",
                "requests": [
                    {
                        "queries": [
                            {
                                "data_source": "slo",
                                "slo_id": "123456abcdeft1234",
                                "measure": "error_budget_burndown",
                                "group_mode": "components",
                                "slo_query_type": "metric"
                            }
                        ],
                        "response_format": "timeseries",
                        "display_type": "line"
                    }
                ],

Checklist

  • Verified against local install of kennel (using path: in Gemfile)
  • Added tests
  • Updated Readme.md (if user facing behavior changed)

@smo921
Copy link
Contributor Author

smo921 commented May 13, 2024

Ready for review. Thanks!

@smo921 smo921 force-pushed the smo921/slo_timeseries_id_lookup branch from 8ab4f21 to 4f85efe Compare May 13, 2024 19:29
@smo921
Copy link
Contributor Author

smo921 commented May 13, 2024

I think I broke something by force pushing a correction in the test comment to my branch :(

@smo921
Copy link
Contributor Author

smo921 commented May 13, 2024

Backing away from this. I think its done. 🙏

lib/kennel/models/dashboard.rb Outdated Show resolved Hide resolved
test/kennel/models/dashboard_test.rb Outdated Show resolved Hide resolved
Readme.md Outdated Show resolved Hide resolved
test/kennel/models/dashboard_test.rb Outdated Show resolved Hide resolved
Comment on lines +262 to +268
it "resolves the slo widget with full id" do
definition[:requests].last[:queries].last[:slo_id] = "#{project.kennel_id}:b"
id_map.set("slo", "a:c", "1")
id_map.set("slo", "#{project.kennel_id}:b", "123")
resolved = resolve
resolved[:requests].last[:queries].last[:slo_id].must_equal "123"
end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice test!

smo921 and others added 4 commits May 14, 2024 08:17
Co-authored-by: Michael Grosser <michael@grosser.it>
Co-authored-by: Michael Grosser <michael@grosser.it>
Co-authored-by: Michael Grosser <michael@grosser.it>
Co-authored-by: Michael Grosser <michael@grosser.it>
@grosser grosser merged commit 19c470b into grosser:master May 14, 2024
2 of 4 checks passed
@grosser
Copy link
Owner

grosser commented May 14, 2024

1.151.0

@smo921 smo921 deleted the smo921/slo_timeseries_id_lookup branch May 14, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants