<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Instrumenting metrics in a C++ application in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Instrumenting-metrics-in-a-C-application/m-p/534802#M89727</link>
    <description>&lt;P&gt;Your application needs to send data to an HTTP endpoint on a Splunk server.&lt;/P&gt;&lt;P&gt;How to instrument your code perhaps is a better question for StackOverflow. One approach, however, is to call a function whenever something you want to measure happens. That function will increment the appropriate static variable. A separate thread initiates a timer and, when the timer pops, collects the measurement variables into a JSON string, sends it to Splunk, then resets the variables. Implementation details are left as an exercise for the reader.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2021 14:46:20 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-01-05T14:46:20Z</dc:date>
    <item>
      <title>Instrumenting metrics in a C++ application</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Instrumenting-metrics-in-a-C-application/m-p/534786#M89724</link>
      <description>&lt;P&gt;Hi, I'm brand new to Splunk coming from a background using Prometheus metrics.&lt;/P&gt;&lt;P&gt;I've been reading through Splunk docs but I'm struggling to get some of the basics down. I was looking at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.1/Metrics/GetMetricsInOther" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.1/Metrics/GetMetricsInOther&lt;/A&gt;&amp;nbsp;which talks about HTTP/JSON but is this saying my application would &lt;EM&gt;offer&lt;/EM&gt; an HTTP endpoint for polling/pulling, or my application needs to&amp;nbsp;&lt;EM&gt;call&lt;/EM&gt; an endpoint on the Splunk server?&lt;/P&gt;&lt;P&gt;I've always worked using the poll paradigm before and one thing I can't seem to find are examples of how to instrument metrics in my own code. In particular, 90% of our system (which comprises dozens of modules) is written in C++ and I would really love to see a code example of instrumenting and exposing a metric (e.g. number of calls to &lt;EM&gt;MyMethod()&amp;nbsp;&lt;/EM&gt;in C++, for consumption by Splunk Enterprise.&lt;/P&gt;&lt;P&gt;Many thanks for any help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 12:15:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Instrumenting-metrics-in-a-C-application/m-p/534786#M89724</guid>
      <dc:creator>MisterBoy</dc:creator>
      <dc:date>2021-01-05T12:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Instrumenting metrics in a C++ application</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Instrumenting-metrics-in-a-C-application/m-p/534802#M89727</link>
      <description>&lt;P&gt;Your application needs to send data to an HTTP endpoint on a Splunk server.&lt;/P&gt;&lt;P&gt;How to instrument your code perhaps is a better question for StackOverflow. One approach, however, is to call a function whenever something you want to measure happens. That function will increment the appropriate static variable. A separate thread initiates a timer and, when the timer pops, collects the measurement variables into a JSON string, sends it to Splunk, then resets the variables. Implementation details are left as an exercise for the reader.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 14:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Instrumenting-metrics-in-a-C-application/m-p/534802#M89727</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-01-05T14:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Instrumenting metrics in a C++ application</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Instrumenting-metrics-in-a-C-application/m-p/534804#M89728</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;. Does Splunk provide any libraries for widely used languages? Measurement code needs to be very performant and thread-safe so this is not a trivial task, especially if either Splunk or the community has already created such things that are tried and tested.&lt;/P&gt;&lt;P&gt;And Splunk is exclusively a push-based metrics store, just to be absolutely double-sure on that?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 14:57:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Instrumenting-metrics-in-a-C-application/m-p/534804#M89728</guid>
      <dc:creator>MisterBoy</dc:creator>
      <dc:date>2021-01-05T14:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Instrumenting metrics in a C++ application</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Instrumenting-metrics-in-a-C-application/m-p/534816#M89731</link>
      <description>&lt;P&gt;Splunk provides a few SDKs: Java, Python, and C#, if memory serves.&amp;nbsp; C++ is not on the list.&lt;/P&gt;&lt;P&gt;Splunk is exclusively push-based, with a few exceptions that don't apply here (like querying an SQL database).&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 15:40:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Instrumenting-metrics-in-a-C-application/m-p/534816#M89731</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-01-05T15:40:30Z</dc:date>
    </item>
  </channel>
</rss>

