Files
Florian LehnerandGitHub 58d1df921a [xscraperhelper] init package (#14235)
#### Description

Along with `scraper/xscraper` this package is needed to enable OTel
Profiling signal receivers, such as
[receiver/pprofreceiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver).

#### Link to tracking issue
Fixes #

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: Florian Lehner <[email protected]>
Signed-off-by: Florian Lehner <[email protected]>
2026-01-09 11:06:50 +00:00

33 lines
1.0 KiB
Go

// Code generated by mdatagen. DO NOT EDIT.
package metadatatest
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/sdk/metric/metricdata"
"go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/scraper/scraperhelper/xscraperhelper/internal/metadata"
)
func TestSetupTelemetry(t *testing.T) {
testTel := componenttest.NewTelemetry()
tb, err := metadata.NewTelemetryBuilder(testTel.NewTelemetrySettings())
require.NoError(t, err)
defer tb.Shutdown()
tb.ScraperErroredProfileRecords.Add(context.Background(), 1)
tb.ScraperScrapedProfileRecords.Add(context.Background(), 1)
AssertEqualScraperErroredProfileRecords(t, testTel,
[]metricdata.DataPoint[int64]{{Value: 1}},
metricdatatest.IgnoreTimestamp())
AssertEqualScraperScrapedProfileRecords(t, testTel,
[]metricdata.DataPoint[int64]{{Value: 1}},
metricdatatest.IgnoreTimestamp())
require.NoError(t, testTel.Shutdown(context.Background()))
}