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

feat: dimensional metrics for elasticsearch.events.processed metric #54

Merged
merged 8 commits into from
Aug 8, 2023

Conversation

kyungeunni
Copy link
Contributor

Instead of creating several metrics having status in names, create a single metric with different attributes/dimensions.

Before -> after

  • elasticsearch.events.processed -> elasticsearch.events.processed {status: "Success"}
  • elasticsearch.failed.client.count -> elasticsearch.events.processed {status: "FailedClient"}
  • elasticsearch.failed.server.count -> elasticsearch.events.processed {status: "FailedServer"}
  • elasticsearch.failed.too_many_reqs -> elasticsearch.events.processed {status: "TooMany"}

The outcome of it is the same with the #53, but it uses synchronous instruments instead.

@@ -411,7 +411,7 @@ func TestAppenderFlushMetric(t *testing.T) {
if !ignoreCount {
assert.Equal(t, count, int(dp.Count))
} else {
assert.Greater(t, int(dp.Count), count)
assert.GreaterOrEqual(t, int(dp.Count), count)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I debugged it locally with the main branch, and it also quite often emits 2 counts here, it should be ok to expect greater or equal than 2 if I'm not mistaken.

appender.go Outdated Show resolved Hide resolved
appender.go Outdated Show resolved Hide resolved
appender.go Outdated Show resolved Hide resolved
@kyungeunni kyungeunni requested a review from axw August 8, 2023 04:57
Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of nitpicks. Thanks!

metric.go Outdated Show resolved Hide resolved
metric.go Outdated Show resolved Hide resolved
@kyungeunni kyungeunni merged commit dd370b9 into elastic:main Aug 8, 2023
2 checks passed
@kyungeunni kyungeunni deleted the dimensional-metrics-sync branch August 8, 2023 05:11
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.

2 participants