title: Problems with telemetry (jtimon/Telegraf) on Juniper OS (Junos)
body: <p>we are trying to set some telemetry environment on a Juniper VMX (virtual) router located on AWS.</p>
  <p>We configured the router following the documentation, and tried to get some telemetry data from it via jtimon and Telegraf.</p>
  <p>The gRPC connection is established and we <strong>do</strong> receive data, but not exactly what we want. Before continuing, I'm sharing the configuration that we use :</p>
  <p>Router configuration (telemetry-related) :</p>
  <pre><code>system {
      services {
          extension-service {
              request-response {
                  grpc {
                      clear-text {
                          port 32767;}
                      skip-authentication;
                  }
              }
              notification {
                  allow-clients {
                      address 0.0.0.0/0;
                  }
              }
          }
      }
      schema {
          openconfig {
              unhide;}
  </code></pre>
  <p>On Telegraf, we have these settings (for example) :</p>
  <pre><code>[[inputs.jti_openconfig_telemetry]]
  
     servers = [&quot;10.0.100.202:32767&quot;]
     sample_frequency = &quot;10000ms&quot;
     sensors = [
      &quot;15000ms /junos/system/linecard/cpu/memory&quot;
      &quot;2000ms  /components&quot;
      ]
     collection_jitter = &quot;0s&quot;
     flush_interval = &quot;15s&quot;
     flush_jitter = &quot;0s&quot;
     precision = &quot;&quot;
     debug = true
     quiet = false
  </code></pre>
  <p>Basically, our sensors gets created on the router, and we can see them with the <code>show agent sensors</code> command. What we cannot understand is that if we change the sensor in the configuration file of Telegraf, we will still receive the information of <strong>all</strong> previously subscribed sensors. To be clear : in the example, we subscribe to <code>/junos/system/linecard/cpu/memory</code> and <code>/components</code>. If I delete these lines, subscribe to <code>/interfaces</code> and run Telegraf, we will receive the information from the <strong>3</strong> sensors (/components, .../cpu/memory and /interfaces).</p>
  <p>As we understand, this is due to an &quot;ephemeral-configuration&quot; called &quot;junos-analytics&quot;, as written in the official documentation :</p>
  <blockquote>
  <p>Starting in Junos OS Release 18.2R1, when an external streaming server, or collector, provisions sensors to export data through gRPC on devices running Junos OS, the sensor configuration is committed to the junos-analytics instance of the ephemeral configuration database, and the configuration can be viewed by using the <strong>show ephemeral-configuration instance junos-analytics</strong> operational command.</p>
  </blockquote>
  <p>Thing is, we don't understand how to edit/disable/delete this &quot;junos-analytics&quot; instance. From what we see, some new sensors (sometimes with the exact same path) get created (with a different sensor ID / name) everytime we run Telegraf. <strong>We don't know how to delete them</strong> (we tried with a <code>delete services analytics sensor *sensor_name*</code> but it resulted in a &quot;statement not found&quot; error message...).</p>
  <p>To sum up, we <strong>do</strong> receive our sensors' data, but it comes in the middle of lots and lots of other (useless) previously subscribed data.</p>
  <p>I feel like we might be missing something in the router configuration, as Telegraf and jtimon show the same behaviour/results.</p>
  <p>Any help is appreciated, I can of course share more information if needed ! Thanks in advance :)</p>