Skip to content

Apply application-wide annotations #21

Description

@icelava

Is there a convenience method to insert annotations for the entire app (all requests should have them)?

Right now seems like needing to customise SegmentCollector.php

public function initHttpTracer(Request $request): void
{
	if (! $this->isTracerEnabled()) {
		return;
	}

	$this->segments = [];
	$tracer = $this->tracer()
		->setTraceHeader($_SERVER['HTTP_X_AMZN_TRACE_ID'] ?? null)
		->setName(config('app.name'))
		->setClientIpAddress($request->getClientIp())
		->addAnnotation('Framework', 'Laravel ' . app()->version())
		->addAnnotation('PHP Version', PHP_VERSION)
		// EXTRA ANNONTATION TO DEFINE SYSTEM BOUNDARY
		->addAnnotation("System", "SYSTEM NAME TO DIFFERENTIATE FROM OTHERS")
		->setUrl($request->url())
		->setMethod($request->method());

	$tracer->begin(100);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions