-
Notifications
You must be signed in to change notification settings - Fork 983
Add tracing suppresing for Metrics Export #3332
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
Changes from 5 commits
b1f6992
c948fa9
555ff46
99c2c78
c0a81d0
f8661d5
86a9c20
3b9b20b
a5d1291
7cf89d5
aeb33e2
799add6
fa08664
9a55db5
b5427ce
be123f1
17948ba
9d92bb1
00614a1
30a1dca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| import { context } from '@opentelemetry/api'; | ||
| import { ExportResult } from './ExportResult'; | ||
| import { suppressTracing } from './trace/suppress-tracing'; | ||
|
|
||
| export interface Exporter<T> { | ||
| export(arg: T, resultCallback: (result: ExportResult) => void): void; | ||
| } | ||
|
|
||
| export function coreExport<T>(exporter: Exporter<T>, arg: T, resultCallback: (result: ExportResult) => void): void { | ||
|
||
| // prevent downstream exporter calls from generating spans | ||
| context.with(suppressTracing(context.active()), () => { | ||
| exporter.export(arg, resultCallback); | ||
| }); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.