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

imc dispatcher metrics show duplicate entries with event_scheme="" #7869

Closed
maschmid opened this issue Apr 24, 2024 · 2 comments · Fixed by #7870
Closed

imc dispatcher metrics show duplicate entries with event_scheme="" #7869

maschmid opened this issue Apr 24, 2024 · 2 comments · Fixed by #7870
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@maschmid
Copy link
Contributor

Describe the bug

imc dispatcher shows duplicate metrics for inmemorychannel_dispatcher_event_count , once with event_scheme="http" and once with event_scheme="" . IIUC, the event_scheme should always be either "http" or "https", so the empty values are always incorrect.

$ curl http://127.0.0.1:9090/metrics 2>/dev/null | grep inmemorychannel_dispatcher_event_count | grep heartbeat
inmemorychannel_dispatcher_event_count{container_name="dispatcher",event_scheme="",event_type="dev.knative.eventing.samples.heartbeat",namespace_name="foobar",response_code="202",response_code_class="2xx",unique_name="imc-dispatcher-6fdfb6c6b6-4ghjq20d5202b49c875bf2309e76baa8d241f"} 59
inmemorychannel_dispatcher_event_count{container_name="dispatcher",event_scheme="http",event_type="dev.knative.eventing.samples.heartbeat",namespace_name="foobar",response_code="202",response_code_class="2xx",unique_name="imc-dispatcher-6fdfb6c6b6-4ghjq20d5202b49c875bf2309e76baa8d241f"} 59

This causes prometheus queries like sum(rate(inmemorychannel_dispatcher_event_count{namespace_name="foobar"}[1m])) to show double of the actual expected event counts.

Expected behavior
There should not be metrics with event_scheme="", if they have already been reported as event_scheme="http"

To Reproduce
deploy a heartbeats example container with a known event rate to an InMemoryChannel (see
https://gist.github.com/maschmid/5ddc22d7703f05e7d656dda7309132af for an example) , watch the imc dispatcher metrics.

Knative release version
1.12

Additional context
Deployed on OpenShift via Serverless Operator CI builds of 1.33 version from https://github.com/openshift-knative/serverless-operator current main branch

@maschmid maschmid added the kind/bug Categorizes issue or PR as related to a bug. label Apr 24, 2024
@maschmid
Copy link
Contributor Author

The problem has been probably introduced by #7581 , with this bit https://github.com/knative/eventing/pull/7581/files#diff-7bb4b380644896204d1e5eae8b917a032179e3d13d7d87ea52c0ef00cc34fdd2R275-R285 looking particularly suspicious to me (but I haven't verified this is indeed the source of the problem)

@Cali0707
Copy link
Member

/assign

Thanks for finding this @maschmid !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants