Giter Club home page Giter Club logo

Comments (4)

jamescrosswell avatar jamescrosswell commented on June 12, 2024

https://develop.sentry.dev/delightful-developer-metrics/sending-metrics-sdk/#units-support

for example: 'byte'

I added a custom one and assumed "bytes" and sentry doesn't format that nicely.

I think this is a server side thing. When we transmit the unit to Sentry, the unit is simply transmitted as a string in the statsd protocol:

await Write(unit.ToString());

Since we're leveraging MeasurementUnit under the hood for the .NET SDK metrics implementation, that means it's this:

public override string ToString() => _unit?.ToString().ToLowerInvariant() ?? _name ?? "";

If we had other enum values, all that would do is give us an indirect way of passing a different string to statsd - but you can do that already with a custom metric.

I suspect in your case it was because you used bytes rather than byte.

from sentry-dotnet.

jamescrosswell avatar jamescrosswell commented on June 12, 2024

Might be worth adding those to MeasurementUnit as well though, to avoid typos like this.

from sentry-dotnet.

jamescrosswell avatar jamescrosswell commented on June 12, 2024

Unless I've misunderstood, it looks like MeasurementUnit already supports all of these:

@bruno-garcia in the code where you were having problems, were you using a custom MeasurementUnit or did you use MeasurementUnit.Information.Byte?

from sentry-dotnet.

bitsandfoxes avatar bitsandfoxes commented on June 12, 2024

Looks like this is covered by MeasureUnit.Information.Byte and Sentry accepts both.

On Sentry:
MeasurementUnit.Custom("bytes")
Image

MeasureUnit.Information.Byte
Image

from sentry-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.