Skip to content

Conversation

@unflxw
Copy link
Contributor

@unflxw unflxw commented Aug 7, 2025

Add endpoints that emit logs and metrics, where missing, to some of the Go, Java and PHP test setups.

This PR is a complement to the docs' PR: https://github.com/appsignal/appsignal-docs/pull/2786

@unflxw unflxw requested a review from tombruijn August 7, 2025 15:39
@unflxw unflxw self-assigned this Aug 7, 2025
@unflxw unflxw added the chore A small task that takes a day or two at the most. label Aug 7, 2025
@unflxw unflxw force-pushed the logging-metrics-go-java-php branch from 17edad5 to bc89d89 Compare August 7, 2025 15:54
// Log different severity levels
julLogger.info("Application started - java.util.logging");
julLogger.log(Level.WARNING, "This is a warning message - java.util.logging");
julLogger.severe("This is an error message - java.util.logging");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool to see the logging adds the trace and span id. We could use that to link to search.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! It's not the only one that does it, I believe. I'll create an issue for it. We'll also have to account for the different ways to send this data that exist, because of course they do.

$gauge->record(10);

// Histogram metric for distributions (measurements)
$histogram = $meter->createHistogram('my_histogram');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The histograms are not being reported for (using a locally build collector using the main branch). I get this message:

appsignal-collector-1  | [2025-08-07T16:53:28 (collector) #1][Debug] Ignoring OpenTelemetry histogram metric: 'my_histogram': Missing min value

appsignal-collector-1  | [2025-08-07T16:53:28 (collector) #1][Debug] Ignoring OpenTelemetry histogram metric: 'my_tagged_histogram': Missing min value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thank you for spotting this! Another ✨ fun ✨ change to the histogram-to-distributions hack incoming, I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, after implementing that and testing that: turns out what the PHP histogram implementation actually does is send exemplars. The bad news is now I have to implement exemplars support. The good news is that exemplars are exactly what we wish we'd get from OpenTelemetry, rather than a histogram that we need to invent plausible values for.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay 👍 Is the PR you linked up-to-date then?

Copy link
Contributor Author

@unflxw unflxw Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That PR is fine and ready to merge IMO (I think it's an overall improvement) but there will be a second PR that actually implements what's necessary in order to support PHP histograms.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! Let's merge it then.

@unflxw unflxw force-pushed the logging-metrics-go-java-php branch from bc89d89 to d830e41 Compare August 12, 2025 14:06
Copy link
Member

@tombruijn tombruijn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving because I trust the setup is good, but the collector is the one that needs to be updated.

@tombruijn tombruijn merged commit 3375c47 into main Aug 19, 2025
70 checks passed
@tombruijn tombruijn deleted the logging-metrics-go-java-php branch August 19, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore A small task that takes a day or two at the most.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants