Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

fix(exporter) attach subsystem label to memory stats #118

Merged
merged 4 commits into from
Apr 26, 2021

Conversation

fffonion
Copy link
Contributor

Memory stats in HTTP and Stream subsystem are independent,
attaching the label so prometheus won't complain about duplicate metrics

@fffonion fffonion force-pushed the fix/memory-subsystem branch from 1610d21 to 3fdaebb Compare March 24, 2021 08:02
@hbagdi
Copy link
Member

hbagdi commented Mar 29, 2021

Please resolve the conflict and rebase.
subsystem is not a good name for a label because it might conflict with existing setups.
kong-subsystem?

@fffonion fffonion force-pushed the fix/memory-subsystem branch 3 times, most recently from 666c899 to 54e87dc Compare March 29, 2021 10:55
@fffonion
Copy link
Contributor Author

@hbagdi Could you take another review?

Copy link
Member

@hbagdi hbagdi left a comment

Choose a reason for hiding this comment

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

LGTM other than the two minor comments.

spec/04-status_api_spec.lua Outdated Show resolved Hide resolved
kong/plugins/prometheus/exporter.lua Outdated Show resolved Hide resolved
@fffonion fffonion force-pushed the fix/memory-subsystem branch from d4b7436 to e82cf8c Compare April 15, 2021 09:25
@fffonion
Copy link
Contributor Author

Need to fix the test.

Memory stats in HTTP and Stream subsystem are independent,
attaching the label so prometheus won't complain about duplicate metrics
@fffonion fffonion force-pushed the fix/memory-subsystem branch 2 times, most recently from df4e64a to ac11f75 Compare April 22, 2021 13:50
@fffonion fffonion force-pushed the fix/memory-subsystem branch from ac11f75 to 7393b1d Compare April 22, 2021 14:30
@fffonion fffonion force-pushed the fix/memory-subsystem branch from 7393b1d to bc65f93 Compare April 22, 2021 16:08
@fffonion
Copy link
Contributor Author

The tests are failing but seems not related 🤔 @hbagdi I addressed your comments and if there's no objection from you I'll merge this PR.

.
# HELP kong_memory_lua_shared_dict_total_bytes Total capacity in bytes of a shared_dict
# TYPE kong_memory_lua_shared_dict_total_bytes gauge
kong_memory_lua_shared_dict_total_bytes{shared_dict="kong",kong_subsystem="http"} 5242880
Copy link
Member

Choose a reason for hiding this comment

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

This metric seems to be different from the rest of the others. All the others are usage metrics but this one seems like a capacity metric.
Should this instead be named as kong_memory_lua_shared_dict_capacity_bytes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hbagdi This is indeed a capacity metric, but it's not newly added in this PR.
I add it into the Readme because it seems got missed before. Consider its
age in the code we should probably keep with the old naming?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, correct. That would be a breaking change.

@hbagdi
Copy link
Member

hbagdi commented Apr 26, 2021

I was about to approve but had one last comment.

Copy link
Member

@hbagdi hbagdi left a comment

Choose a reason for hiding this comment

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

I'm approving but please take care of the CI soon.

@fffonion fffonion merged commit 95a5907 into master Apr 26, 2021
@fffonion fffonion deleted the fix/memory-subsystem branch April 26, 2021 16:44
fffonion added a commit to Kong/kong that referenced this pull request Jun 2, 2021
- Fix exporter to attach subsystem label to memory stats
  [#118](Kong/kong-plugin-prometheus#118)
- Expose dataplane status on control plane, new metrics `data_plane_last_seen`,
  `data_plane_config_hash` and `data_plane_version_compatible` are added.
  [#98](Kong/kong-plugin-prometheus#98)
dndx pushed a commit to Kong/kong that referenced this pull request Jun 2, 2021
- Fix exporter to attach subsystem label to memory stats
  [#118](Kong/kong-plugin-prometheus#118)
- Expose dataplane status on control plane, new metrics `data_plane_last_seen`,
  `data_plane_config_hash` and `data_plane_version_compatible` are added.
  [#98](Kong/kong-plugin-prometheus#98)
fffonion added a commit that referenced this pull request Jun 9, 2021
Memory stats in HTTP and Stream subsystem are independent,
attaching the label so prometheus won't complain about duplicate metrics
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants