GoogleCloudPlatform / functions-framework-java

FaaS (Function as a service) framework for writing portable Java functions
Apache License 2.0
130 stars 63 forks source link

Trace support in google functions #251

Closed SButterfly closed 8 months ago

SButterfly commented 8 months ago

Hello. I am struggling with how to add trace support to Google functions java SDK.

In my classpath I have added only functions-framework-api

    <dependency>
      <groupId>com.google.cloud.functions</groupId>
      <artifactId>functions-framework-api</artifactId>
    </dependency>

And implemented my custom function from HttpFunction interface.

But still, I don't see any traces in the trace-explorer.

HKWinterhalter commented 8 months ago

Hi @SButterfly, you may have seen this but here is the documentation around Tracing - https://cloud.google.com/trace/docs/overview

You may want to try using cloud logging client (Operations Suite) - https://cloud.google.com/logging/docs/reference/libraries

Please also see: https://cloud.google.com/functions/docs/monitoring/logging#processing_special_json_fields_in_messages and https://cloud.google.com/logging/docs/agent/logging/configuration#special-fields