27 Apr 2023
02:42 AM
- last edited on
27 Apr 2023
11:21 PM
by
MaciejNeumann
Hi Everyone,
I maintain an open-source API Management project; we have a rich time-series data stream that we output that is very useful for analytics (typically into Elasticsearch or InfluxDB etc). We call it metrics, but it doesn't really map perfectly onto Dynatrace's definition of metrics — I would write a plugin for the platform to allow it to push that data directly to Dynatrace (e.g. via OneAgent or to the cloud).
My first instinct was to use the Dynatrace Metrics v2 API, but I'm not sure whether I'm trying to bash a square peg into a round hole. It really only seems to want the values to be numbers (literal number, gauge, or counter), and not strings. For example, a classic value would be the endpoint that was accessed.
Here is what a single metric record looks like from the API Management solution (pseudo-code to demonstrate the data, ignore the specific format). Each request-response through the gateway would produce its own record, which we aggregate, transform into platform-specific formats, and then push into the corresponding platform.
apiId="foo" // identifier
apiOrgId="test" // identifier
apiVersion="1.0" // identifier
requestStart="1682448091736" // timestamp for when request started
requestEnd="1682448092015" // timestamp for when request ended
apiStart="1682448091739" // timestamp (similar to above, but backend only)
apiEnd="1682448092013" // timestamp (similar to above, but backend only)
url="https://localhost:8443/apiman-gateway/test/foo/1.0"
method="GET" // HTTP Method that was proxied
responseCode="200" // HTTP response code
responseMessage="OK" // HTTP response message
failureCode="0" // If an error occurred its code would be shown here
error="false"
custom.request.header.X-Correlation-Id="1234-4949-4693" // Some custom header captured by the user's config
From reading the Dynatrace documentation and using your definitions, depending how you squint at this, a dataset like this could be:
I've read through your docs a few times and I am not sure how I should tackle this.
All guidance is much appreciated.
TL;DR: I'd like a way to get the sample data into Dynatrace, and ideally also provide some metadata/schema (etc), to allow Dynatrace to understand the meaning of the data. Is this possible via APIs?