node-datadog-metrics icon indicating copy to clipboard operation
node-datadog-metrics copied to clipboard

Can I submit metrics with a client token? (instead of api_key+app_key)

Open aguynamedben opened this issue 4 years ago • 1 comments

Hi, thanks for making this library available.

I'm building an Electron app and want to collect metrics from it. The Datadog RUM/logging systems support intake using a client token, which is a write-only credential for use in the web browser and apps where source code is comprisable.

Have you found a way with the metrics APIs to submit metrics using the client token? I'm poking around but the API keeps telling me I need an api_key. Thanks for any help you could provide on this.

aguynamedben avatar Jul 17 '20 23:07 aguynamedben

Is that repository dead or still maintained ? I'm also using a client token.

jaybe78 avatar Feb 04 '22 17:02 jaybe78

Hi @aguynamedben and @jaybe78, are either of you still using this and is it still a pressing need? I’ve been making a few PRs to support a client who’s using this, and maintainers have been responsive to those changes.

If it’s still useful to you, I might take a look at whether this is possible (unless I miss my mark, the DataDog’s RUM packages use different APIs than this does, so I’m not totally sure a token will work without bigger changes) if I’ve got some extra time.

Mr0grog avatar Sep 19 '22 22:09 Mr0grog

I poked around at this a little, and there does not seem to be a way to use client tokens with the standard API (which we use to submit metrics) — only the RUM and browser logs (different from normal logs) APIs, which are hosted at entirely different domains and have different endpoints and parameters (e.g. RUM is at rum-browser-intake-datadoghq.com). Beyond that, it doesn’t look like there is any metrics support in the RUM API — you can generate metrics from your RUM actions and events, but not submit metrics directly.

(I also couldn’t find any technical documentation on these APIs and had to dig through the browser SDK source. If you know of any actual docs, please post here.)

Ultimately, it doesn’t seem like there’s a reasonable way to do this, so I’m going to close this issue. If you know more, please post here. Otherwise I recommend using DataDog’s official RUM packages if you really need client tokens.

Mr0grog avatar Sep 23 '22 05:09 Mr0grog

Not using it, thank you for asking

aguynamedben avatar Sep 23 '22 23:09 aguynamedben