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

[chore] Add logs and metrics k8s attributes verification tests #1610

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

Conversation

pszkamruk-splunk
Copy link
Contributor

Description: Adding resource attributes tests to ensure that events and metrics are enriched with additional k8s attributes

Testing: additional tests

Documentation: N/A

@pszkamruk-splunk pszkamruk-splunk requested review from a team as code owners January 13, 2025 12:54
@pszkamruk-splunk pszkamruk-splunk changed the title [chore] Add k8s resource attributes tests [chore] Add k8s resource attributes verification tests Jan 13, 2025
return resourceAttributes, notFoundCounter
}

func getMetricsResourceAttribute(metrics []pmetric.Metrics, attributeName string) ([]string, int) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you're checking on a metric attribute, not a resource attribute

Suggested change
func getMetricsResourceAttribute(metrics []pmetric.Metrics, attributeName string) ([]string, int) {
func getMetricsAttribute(metrics []pmetric.Metrics, attributeName string) ([]string, int) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@atoulme my understanding of what I am checking here is probably incorrect. I thought I am checking in these tests resourceAttributes, but actually I am checking logs/metrics attributes. Should I update the variables and function names from resourceAttributes to logs/metricsAttributes, getLogsResourceAttribute to getLogsAttribute, etc.?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, it's misleading otherwise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renaming done

@pszkamruk-splunk pszkamruk-splunk changed the title [chore] Add k8s resource attributes verification tests [chore] Add logs and metrics k8s attributes verification tests Jan 15, 2025
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