Skip to content
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

Apply application-wide annotations #21

Open
icelava opened this issue Dec 2, 2021 · 0 comments
Open

Apply application-wide annotations #21

icelava opened this issue Dec 2, 2021 · 0 comments

Comments

@icelava
Copy link

icelava commented Dec 2, 2021

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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant