Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json output #1569

Closed
iomari opened this issue Jul 28, 2022 · 3 comments
Closed

json output #1569

iomari opened this issue Jul 28, 2022 · 3 comments

Comments

@iomari
Copy link

iomari commented Jul 28, 2022

Greetings,
I'm running the following command:

opentelemetry-instrument --traces_exporter console,otlp_proto_http --metrics_exporter console flask run

How can I get my console metric output to like:

{
  "resource_metrics": [
    {
      "resource": {
        "attributes": {
          "telemetry.sdk.language": "python",
          "telemetry.sdk.name": "opentelemetry",
          "telemetry.sdk.version": "1.12.0rc1",
          "telemetry.auto.version": "0.31b0",
          "service.name": "unknown_service"
        },
        "schema_url": ""
      },
      "scope_metrics": [
        {
          "scope": {
            "name": "app",
            "version": "",
            "schema_url": null
          },
          "metrics": [
            {
              "name": "roll_counter",
              "description": "The number of rolls by roll value",
              "unit": "",
              "data": {
                "data_points": [
                  {
                    "attributes": {
                      "roll.value": 4
                    },
                    "start_time_unix_nano": 1654790325350232600,
                    "time_unix_nano": 1654790332211598800,
                    "value": 3
                  },
                  {
                    "attributes": {
                      "roll.value": 6
                    },
                    "start_time_unix_nano": 1654790325350232600,
                    "time_unix_nano": 1654790332211598800,
                    "value": 4
                  },
                  {
                    "attributes": {
                      "roll.value": 5
                    },
                    "start_time_unix_nano": 1654790325350232600,
                    "time_unix_nano": 1654790332211598800,
                    "value": 1
                  },
                  {
                    "attributes": {
                      "roll.value": 1
                    },
                    "start_time_unix_nano": 1654790325350232600,
                    "time_unix_nano": 1654790332211598800,
                    "value": 2
                  },
                  {
                    "attributes": {
                      "roll.value": 3
                    },
                    "start_time_unix_nano": 1654790325350232600,
                    "time_unix_nano": 1654790332211598800,
                    "value": 1
                  }
                ],
                "aggregation_temporality": 2,
                "is_monotonic": true
              }
            }
          ],
          "schema_url": null
        }
      ],
      "schema_url": ""
    }
  ]
}

instead of like this:

{"resource_metrics": [{"resource": {"attributes": {"telemetry.sdk.language": "python", "telemetry.sdk.name": "opentelemetry", "telemetry.sdk.version": "1.12.0rc2", "service.name": "inspired", "telemetry.auto.version": "0.32b0"}, "schema_url": ""}, "scope_metrics": [{"scope": {"name": "app", "version": "", "schema_url": ""}, "metrics": [{"name": "roll_counter", "description": "The number of rolls by roll value", "unit": "", "data": {"data_points": [{"attributes": {"roll.value": 93351}, "start_time_unix_nano": 1658947583189784828, "time_unix_nano": 1658947637183833820, "value": 1}, {"attributes": {"roll.value": 420808}, "start_time_unix_nano": 1658947583189784828, "time_unix_nano": 1658947637183833820, "value": 58}, {"attributes": {"roll.value": 205885}, "start_time_unix_nano": 1658947583189784828, "time_unix_nano": 1658947637183833820, "value": 85}, {"attributes": {"roll.value": 871679}, "start_time_unix_nano": 1658947583189784828, "time_unix_nano": 1658947637183833820, "value": 8}], "aggregation_temporality": 2, "is_monotonic": true}}], "schema_url": ""}], "schema_url": ""}]}

@cartermp
Copy link
Contributor

cartermp commented Jul 31, 2022

@iomari could you specify your steps to reproduce this behavior? Specifically, steps run to create the app in the first place (packages installed, etc.) and sharable code if possible.

@svrnm
Copy link
Member

svrnm commented Aug 16, 2022

@iomari any updates before we close this issue?

@svrnm
Copy link
Member

svrnm commented Aug 23, 2022

@iomari, I am closing this issue now, please re-open it with the requested info. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants