Apm-agent-dotnet: Public API Span Labels Length Issue

Created on 1 Nov 2019  路  15Comments  路  Source: elastic/apm-agent-dotnet

Captured Span Label Values Show truncating String,

I am using dotnet apm public api.

my requirement is to assign a label to span which is large text( Generally its large XML String),
if i do that in general way ,it shows truncated string instead of full string on kibanna dashboard.

if there any solution exist, Greatly Appreciated .

discuss

All 15 comments

Hi @soumithx,

labels are truncated to 1024 characters, so I'm afraid you won't be able to store very long XMLs there.

This is specified in the API between the agent and the APM server, so this statement holds to all Elastic APM agents, so this isn't specific to the .NET APM Agent - so what I want to say with this second part is that this is not something we could easily change in the agent.

Removed the bug label, because this is by design.

@gregkalapos ,

Hi Greg , then what is best way to display , is there any custom instrumentation we can apply to achieve ?

@gregkalapos ,

Hi Greg , then what is best way to display , is there any custom instrumentation we can apply to achieve ?

I'm not sure we have anything on the public API that you can use to transfer that amount of data. The big problem with this would be that this could lead to huge data usage by elasticsearch very easily.

Off the top of my head, I'm not sure if we have any field where you could transfer unlimited data to the APM server, but I asked the rest of the team if we have something on the APM server API to this - I'll report back here once I know more. If there is something we could expose thorough the agent API then I'm totally open for considering it.

Could you maybe say a little bit more about your use case? Like, what kind of span is this? Where is the XML coming from?

@gregkalapos ,

its custom Captured Span through public Api, i can say this is not pure XML ,but its an just XML look like string which created by Stringbuilder

some how , i got breakthrough by attaching that string as Context.Db Database statement .....

still , that size is not yet completely fitted

some how , i got breakthrough by attaching that string as Context.Db Database statement .....

still , that size is not yet completely fitted

:) the limit on that is 10000. Plus the other problem is that that is not intended for this use case.

Soo.. there is 1 field on the Transaction in the APM Server's intake API that we could use for this: https://github.com/elastic/apm-server/blob/master/docs/spec/context.json#L7

That field is unfortunately not yet exposed in .NET, but we could add it. The only thing with this is that it is on the Transaction, so still not something for Spans.

Here is how it's exposed in the Java agent.

@gregkalapos ,
If you add it. That works for me :)

@gregkalapos ,
If you add it. That works for me :)

Perfect! From what I see right now (Friday night 23:05 for me here :) ) I think we can easily add it. I'll follow up on this.

Thanks alot :)

Hi @gregkalapos ,

Any update ?

@soumithx I opened #585.

First that needs to be reviewed and merged, and once that's done it'll be in the next release. This milestone has all the issues we planned for the next release, so probably once that goes to 0 open issues we'll have this release.

Thanks @gregkalapos 馃

I think it's the same feature as the one at https://github.com/elastic/apm-agent-dotnet/issues/419

Implemented in #585.

Was this page helpful?
0 / 5 - 0 ratings