public configureContext()

in src/environment/ECSEnvironment.ts [119:135]


  public configureContext(context: MetricsContext): void {
    this.addProperty(context, 'containerId', os.hostname());
    this.addProperty(context, 'createdAt', this.metadata?.CreatedAt);
    this.addProperty(context, 'startedAt', this.metadata?.StartedAt);
    this.addProperty(context, 'image', this.metadata?.Image);
    this.addProperty(context, 'cluster', this.metadata?.Labels['com.amazonaws.ecs.cluster']);
    this.addProperty(context, 'taskArn', this.metadata?.Labels['com.amazonaws.ecs.task-arn']);

    // we override the standard default dimensions here because in the
    // FireLens / fluent-bit case, we don't need the LogGroup
    if (this.fluentBitEndpoint) {
      context.setDefaultDimensions({
        ServiceName: config.serviceName || this.getName(),
        ServiceType: config.serviceType || this.getType(),
      });
    }
  }