-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add obs for logs in scraper/scraperhelper #12036
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12036 +/- ##
==========================================
- Coverage 91.67% 91.65% -0.02%
==========================================
Files 455 456 +1
Lines 24010 24073 +63
==========================================
+ Hits 22010 22063 +53
- Misses 1629 1638 +9
- Partials 371 372 +1 ☔ View full report in Codecov by Sentry. |
@bogdandrutu |
@@ -86,6 +86,12 @@ func (tts *TestTelemetry) CheckReceiverMetrics(protocol string, acceptedMetricPo | |||
return checkReceiverMetrics(tts.reader, tts.id, protocol, acceptedMetricPoints, droppedMetricPoints) | |||
} | |||
|
|||
// CheckScraperLogs checks that for the current exported values for logs scraper metrics match given values. | |||
// Note: SetupTelemetry must be called before this function. | |||
func (tts *TestTelemetry) CheckScraperLogs(receiver component.ID, scraper component.ID, scrapedLogRecords, erroredLogRecords int64) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am actually planning to remove the other one. So I don't think this is necessary.
@@ -15,6 +15,13 @@ import ( | |||
"go.opentelemetry.io/collector/component" | |||
) | |||
|
|||
func checkScraperLogs(reader *sdkmetric.ManualReader, receiver component.ID, scraper component.ID, scrapedLogRecords, erroredLogRecords int64) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
switch { | ||
case params[i].err == nil: | ||
scrapedLogRecords += params[i].items | ||
require.Contains(t, span.Attributes(), attribute.KeyValue{Key: scrapedLogRecordsKey, Value: attribute.Int64Value(int64(params[i].items))}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use attribute.Int64
instead of manually construct the key and the value?
Description
This PR adds obs for logs in scraper/scraperhelper, also introduced new metrics for scraping logs.
Link to tracking issue
Relates to #11238
Testing
Added
Documentation
Added