Application Insights REST API POST Metric

Grzegorz Siekaniec 1 Reputation point
2020-08-24T09:31:33.63+00:00

I would like to use Application Rest API to POST custom metrics. According to the API Explorer (https://dev.applicationinsights.io/apiexplorer/postMetrics?appId=DEMO_APP&apiKey=DEMO_KEY) it should be possible. However I have not found any documentation on how a body of such a request should look like. Can you point me to the documentation that might explain it? Use case is to track metric from c++ which is not supported by any of existing SDKs.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,320 questions
{count} votes

1 answer

Sort by: Most helpful
  1. tbgangav-MSFT 10,416 Reputation points
    2020-08-25T15:50:47.757+00:00

    Hi @Grzegorz Siekaniec ,

    This is the API reference for the API you are referring to which explains request body schema with two examples.

    Also, as per this reference, the content-type header field is “application/json” so formatted body would accept JSON content as body. For reference, please check below screenshot.

    20080-aai1.png

    As per this and this document references, JSON content under request body is valid. For reference, please check below screenshots.

    20190-aai2.png

    20282-aai3.png

    For illustration, please check below screenshots.

    20311-aai4.png

    20312-aai5.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.