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

[cmd/telemetrygen] Export telemetrygen functions for testing #37044

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

Conversation

Erog38
Copy link
Contributor

@Erog38 Erog38 commented Jan 6, 2025

Description

This PR addresses #36984 in order to open up telemetrygen to be used by golang tests and generate varying amounts of telemetry in code to support use cases which don't rely on external tools.

Testing

Added to the E2E tests to ensure consistent API specs. Additionally had to adjust log and metric exporter instantiation slightly due to a race condition with an err variable.

@Erog38 Erog38 requested review from mx-psi, codeboten and a team as code owners January 6, 2025 23:45
@github-actions github-actions bot added the cmd/telemetrygen telemetrygen command label Jan 6, 2025
@Erog38 Erog38 changed the title feat: Export telemetrygen functions for testing [cmd/telemetrygen] Export telemetrygen functions for testing Jan 6, 2025
@Erog38
Copy link
Contributor Author

Erog38 commented Jan 6, 2025

This goes hand in hand with #37003 in order to help own and maintain this API. I read about chloggen, but haven't used it before so I copied the template and made a version manually. I hope I did that properly.

Copy link

codecov bot commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 15.17857% with 190 lines in your changes missing coverage. Please review.

Project coverage is 79.57%. Comparing base (1629eda) to head (a719b82).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
cmd/telemetrygen/pkg/logs/logs.go 8.88% 39 Missing and 2 partials ⚠️
cmd/telemetrygen/pkg/metrics/metrics.go 8.88% 39 Missing and 2 partials ⚠️
cmd/telemetrygen/internal/common/config.go 0.00% 29 Missing ⚠️
cmd/telemetrygen/pkg/traces/config.go 15.15% 28 Missing ⚠️
cmd/telemetrygen/pkg/logs/config.go 35.13% 24 Missing ⚠️
cmd/telemetrygen/pkg/metrics/config.go 0.00% 18 Missing ⚠️
cmd/telemetrygen/pkg/metrics/metrics_types.go 0.00% 5 Missing ⚠️
cmd/telemetrygen/pkg/traces/traces.go 33.33% 2 Missing ⚠️
cmd/telemetrygen/config.go 75.00% 1 Missing ⚠️
cmd/telemetrygen/pkg/metrics/worker.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #37044      +/-   ##
==========================================
- Coverage   79.60%   79.57%   -0.03%     
==========================================
  Files        2250     2250              
  Lines      211890   211951      +61     
==========================================
- Hits       168676   168668       -8     
- Misses      37540    37608      +68     
- Partials     5674     5675       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/telemetrygen telemetrygen command
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants