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

Request response metrics - Experience using Azure Insights and Californium #2193

Open
brbd1 opened this issue Nov 8, 2023 · 8 comments
Open

Comments

@brbd1
Copy link

brbd1 commented Nov 8, 2023

I am utilizing the Spring Boot framework to expose a CoAP server POST API. However, Azure App Insights is missing request metrics for these requests. When comparing with REST controller GET and POST requests, I've observed that they are being logged, but CoAP requests are not. I suspect that someone might have encountered a similar issue. I am seeking guidance regarding any special configurations or code changes that might be necessary to address this.

Command used to run app insights: java -javaagent:applicationinsights-agent-3.4.17.jar -jar .\demo-0.0.1-SNAPSHOT.jar

Update:

I've created a basic CoAP server without Spring Boot and performed tests using Azure insights. Despite this, the issue persists, indicating that it's unrelated to Spring Boot. My current assumption is that they're solely monitoring the HTTP protocol, not the UDP/COAP protocol.

@boaks
Copy link
Contributor

boaks commented Nov 9, 2023

However, Azure App Insights is missing request metrics for these requests.

I'm not common to "Azure app Insights" so I don't have any information, what the "request metrics" contains or which API that should use.

@boaks
Copy link
Contributor

boaks commented Nov 9, 2023

Despite this, the issue persists

I'm still not common to "Azure insights".

My current assumption is that they're solely monitoring the HTTP protocol, not the COAP protocol.

I guess so. If "Azure insights" offers a API to feed the data in, Californium has some API to provide some metrics. the glue between both API is then something you need to implement. But without any idea, how that "Azure insights" looks like, I'm not able to help you further.

@brbd1
Copy link
Author

brbd1 commented Nov 9, 2023

Californium has some API to provide some metrics --> could you please share pointers on this, I will see how I can implement.

"Azure insights" is auto wired at JVM level. This is how it will get injected.
java -javaagent:applicationinsights-agent-3.4.17.jar -jar .\demo-0.0.1-SNAPSHOT.jar

@boaks
Copy link
Contributor

boaks commented Nov 9, 2023

"Azure insights" is auto wired at JVM level.

Then I guess you need to ask Microsoft, how that "auto wired at JVM level" works. Or ask Microsoft to support "Californium".

@boaks
Copy link
Contributor

boaks commented Nov 9, 2023

For internal metric, Californium uses several callback interfaces in combination with a CounterStatisticManager implementation, e.g. NetStatLogger and NetSocketHealthLogger (both are only available for unix). Or DtlsHealthLogger for DTLS 1.2 and HealthStatisticLogger for CoAP.

These components are collecting the internal metrics. To read the values, a coap-resource similar to

Diagnose

maybe used. Or these metrics are forwarded to some other APIs. That's all not that easy, so before you start to spend time in it, I guess it wold help much more to see, how that data is intended to be passed to ""Azure insights" is auto wired at JVM level", otherwise you'r in danger of spending that time in vain.

@boaks
Copy link
Contributor

boaks commented Nov 9, 2023

I had a short view on the info at Application Insights. Unfortunately, I wasn't able to find some information, how that is intended to work with a "unprepared third party library" as Californium.
I guess, you need to ask Microsoft. I will not be able to help you without the information, how to prepare java code in order to be used by the "auto wired at JVM level".

@boaks
Copy link
Contributor

boaks commented Nov 9, 2023

Let me recommend to adapt the title to be more specific, e.g.:

Experience using Azure Insights and Californium?

@brbd1 brbd1 changed the title Request response metrics Request response metrics - Experience using Azure Insights and Californium Nov 9, 2023
@rogierc
Copy link
Contributor

rogierc commented Jan 12, 2024

No experience here. But reading the docs (https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-overview?tabs=aspnetcore) Azure seems to use OpenTelemetry.

OpenTelemetry has different options for collecting metrics. One is using a custom agent. An example here: https://github.com/open-telemetry/opentelemetry-java-examples/blob/main/javaagent/src/main/java/io/opentelemetry/example/javagent/Controller.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants