Skip to content

Configure ResourceAttributes via appsettings.json #398

@steverb38

Description

@steverb38

Hi,

Any suggestions on how to specifiy ResourceAttributes when configuring the sink via appsettings.json?
Specifying Endpoint and Protocol in appsettings.json works fine, but I can't get the syntax for specifying the Dictionary<string, object> for ResourceAttributes:

This is my attempt in appsettings.json - the service.name attribute doesn't end up as "myapp-test", but some default value "unknown_service:...":

   "WriteTo": [
      {
        "Name": "OpenTelemetry",
        "Args": {
          "endpoint": "http://MyOtelCollectorServer:4318/v1/logs",
          "protocol": "HttpProtobuf",
          "resourceAttributes": {
			"service.name" : "myapp-test"
		   }
		}
          }
    ],

Is this even possible?

Steve

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions