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: add dynamic labels #492

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

emanuelmt
Copy link

@emanuelmt emanuelmt commented Jul 31, 2024

Description

This PR adds the possibility to define dynamic attributes to server request and response metrics. Can be used with req and res params.

  • created e2e test

Fixes #123

@SetupCZ
Copy link

SetupCZ commented Nov 28, 2024

Hey, I would like to leave a +1 for this one. I would really need this feature so I don't have to implement my own middleware for one property.

metrics: {
apiMetrics: {
enable: true,
dynamicAttributes: () => ({ dynamicLabel: 'dynamicLabelValue' }),
Copy link
Owner

Choose a reason for hiding this comment

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

Could you make sure you use something from req here, this PR was introduced to support dynamic attributes but the test is testing the same as defaultAttributes (static values)

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.

API metrics dynamic labels
3 participants