File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
packages/resource-detector-gcp/src/detectors Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18+ import { context } from '@opentelemetry/api' ;
19+ import { suppressTracing } from '@opentelemetry/core' ;
1820import {
1921 CLOUDPLATFORMVALUES_GCP_APP_ENGINE ,
2022 CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS ,
@@ -207,7 +209,11 @@ async function makeResource(attrs: GcpResourceAttributes): Promise<Resource> {
207209 */
208210export class GcpDetector implements ResourceDetector {
209211 private async _asyncAttributes ( ) : Promise < Attributes > {
210- return ( await detect ( ) ) . attributes ;
212+ const resource = await context . with (
213+ suppressTracing ( context . active ( ) ) ,
214+ detect
215+ ) ;
216+ return resource . attributes ;
211217 }
212218
213219 detect ( ) : DetectedResource {
You can’t perform that action at this time.
0 commit comments