@tigorhutasuhut/telemetry-js - v0.7.3
    Preparing search index...

    Interface Resource

    An interface that represents a resource. A Resource describes the entity for which signals (metrics or trace) are collected.

    This interface is NOT user-implementable. Valid ways to obtain a Resource are by using either of these functions

    • resourceFromAttributes
    • emptyResource
    • defaultResource
    • detectResources
    interface Resource {
        asyncAttributesPending?: boolean;
        attributes: Attributes;
        schemaUrl?: string;
        getRawAttributes(): RawResourceAttribute[];
        merge(other: Resource | null): Resource;
        waitForAsyncAttributes?(): Promise<void>;
    }
    Index

    Properties

    asyncAttributesPending?: boolean

    Check if async attributes have resolved. This is useful to avoid awaiting waitForAsyncAttributes (which will introduce asynchronous behavior) when not necessary.

    true if the resource "attributes" property is not yet settled to its final value

    attributes: Attributes

    the Resource's attributes.

    schemaUrl?: string

    the Resource's schema URL or undefined if not set.

    Methods

    • Returns RawResourceAttribute[]

    • Returns a new, merged Resource by merging the current Resource with the other Resource. In case of a collision, other Resource takes precedence.

      Parameters

      • other: Resource | null

        the Resource that will be merged with this.

      Returns Resource

      the newly merged Resource.

    • Returns a promise that will never be rejected. Resolves when all async attributes have finished being added to this Resource's attributes. This is useful in exporters to block until resource detection has finished.

      Returns Promise<void>