congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
MeasurementSession.getApplicationName
Code IndexAdd Tabnine to your IDE (free)

How to use
getApplicationName
method
in
org.stagemonitor.core.MeasurementSession

Best Java code snippets using org.stagemonitor.core.MeasurementSession.getApplicationName (Showing top 11 results out of 315)

origin: stagemonitor/stagemonitor

private static void addCheck(Check check, MeasurementSession measurementSession) {
  check.setApplication(measurementSession.getApplicationName());
  try {
    configuration.getConfig(AlertingPlugin.class).addCheck(check);
  } catch (IOException e) {
    logger.warn(e.getMessage(), e);
  }
}
origin: stagemonitor/stagemonitor

private String getGraphitePrefix(MeasurementSession measurementSession) {
  return name("stagemonitor",
      sanitizeGraphiteMetricSegment(measurementSession.getApplicationName()),
      sanitizeGraphiteMetricSegment(measurementSession.getInstanceName()),
      sanitizeGraphiteMetricSegment(measurementSession.getHostName()));
}
origin: stagemonitor/stagemonitor

@Override
public void reportMetrics(Map<MetricName, Gauge> gauges, Map<MetricName, Counter> counters, Map<MetricName, Histogram> histograms, Map<MetricName, Meter> meters, Map<MetricName, Timer> timers) {
  Map<String, Map<MetricName, Metric>> metricsGroupedByName = new HashMap<String, Map<MetricName, Metric>>();
  addMetrics(metricsGroupedByName, gauges);
  addMetrics(metricsGroupedByName, counters);
  addMetrics(metricsGroupedByName, histograms);
  addMetrics(metricsGroupedByName, meters);
  addMetrics(metricsGroupedByName, timers);
  for (Check check : alertingPlugin.getChecks().values()) {
    if (measurementSession.getApplicationName().equals(check.getApplication()) && check.isActive()) {
      checkMetrics(metricsGroupedByName, check);
    }
  }
}
origin: stagemonitor/stagemonitor

@Override
public Tracer getTracer(StagemonitorPlugin.InitArguments initArguments) {
  final Tracing braveTracer = Tracing.newBuilder()
      .localServiceName(initArguments.getMeasurementSession().getApplicationName())
      .reporter(getZipkinReporterBuilder(initArguments).build())
      .sampler(getSampler())
      .build();
  return BraveTracer.newBuilder(braveTracer)
      .textMapPropagation(B3HeaderFormat.INSTANCE, Propagation.B3_STRING)
      .build();
}
origin: stagemonitor/stagemonitor

@Override
public Tracer getTracer(StagemonitorPlugin.InitArguments initArguments) {
  final B3TextMapCodec b3TextMapCodec = new B3TextMapCodec.Builder().build();
  final JaegerTracer.Builder builder = new JaegerTracer.Builder(
      initArguments.getMeasurementSession().getApplicationName())
      .withReporter(new NoopReporter())
      .withSampler(new ConstSampler(true))
      .registerInjector(B3HeaderFormat.INSTANCE, b3TextMapCodec)
      .registerInjector(Format.Builtin.HTTP_HEADERS, b3TextMapCodec)
      .registerExtractor(Format.Builtin.HTTP_HEADERS, b3TextMapCodec);
  return builder.build();
}
origin: stagemonitor/stagemonitor

@Override
public void onStart(SpanWrapper spanWrapper) {
  if (corePlugin.isStagemonitorActive()) {
    final MeasurementSession measurementSession = corePlugin.getMeasurementSession();
    if (measurementSession != null) {
      addToMdcIfNotNull("application", measurementSession.getApplicationName());
      addToMdcIfNotNull("host", measurementSession.getHostName());
      addToMdcIfNotNull("instance", measurementSession.getInstanceName());
    }
    // don't store the context in MDC if stagemonitor is not active
    // so that thread pools that get created on startup don't inherit the ids
    if (Stagemonitor.isStarted()) {
      tracingPlugin.getTracer().inject(spanWrapper.context(), B3HeaderFormat.INSTANCE, new B3HeaderFormat.B3InjectAdapter() {
        @Override
        public void setParentId(String value) {
        }
        @Override
        public void setSpanId(String value) {
          addToMdcIfNotNull("spanId", value);
        }
        @Override
        public void setTraceId(String value) {
          addToMdcIfNotNull("traceId", value);
        }
      });
    }
  }
}
origin: stagemonitor/stagemonitor

  @Test
  public void testToJson() throws Exception {
    MeasurementSession measurementSession = new MeasurementSession("app", "host", "instance");
    final MeasurementSession jsonSession = JsonUtils.getMapper().readValue(JsonUtils.toJson(measurementSession), MeasurementSession.class);
    assertEquals(measurementSession.getApplicationName(), jsonSession.getApplicationName());
    assertEquals(measurementSession.getHostName(), jsonSession.getHostName());
    assertEquals(measurementSession.getInstanceName(), jsonSession.getInstanceName());
    assertEquals(measurementSession.getInstanceName(), jsonSession.getInstanceName());
    assertEquals(measurementSession.getId(), jsonSession.getId());
    assertEquals(measurementSession.getStart(), jsonSession.getStart());
  }
}
origin: org.stagemonitor/stagemonitor-requestmonitor

public RequestTrace(String requestId, MeasurementSession measurementSession, RequestMonitorPlugin requestMonitorPlugin) {
  this.requestMonitorPlugin = requestMonitorPlugin;
  this.id = requestId != null ? requestId : UUID.randomUUID().toString();
  this.measurementStart = measurementSession.getStartTimestamp();
  this.application = measurementSession.getApplicationName();
  this.host = measurementSession.getHostName();
  this.instance = measurementSession.getInstanceName();
  this.timestamp = StringUtils.dateAsIsoString(new Date());
}
origin: org.stagemonitor/stagemonitor-web

@Override
public void requestInitialized(ServletRequestEvent sre) {
  if (corePlugin.isStagemonitorActive()) {
    final MeasurementSession measurementSession = corePlugin.getMeasurementSession();
    if (measurementSession.getApplicationName() != null) {
      MDC.put("application", measurementSession.getApplicationName());
    }
    if (measurementSession.getHostName() != null) {
      MDC.put("host", measurementSession.getHostName());
    }
    String instanceName = measurementSession.getInstanceName();
    if (instanceName == null) {
      instanceName = sre.getServletRequest().getServerName();
    }
    MDC.put("instance", instanceName);
    final String requestId = UUID.randomUUID().toString();
    sre.getServletRequest().setAttribute(STAGEMONITOR_REQUEST_ID_ATTR, requestId);
    if (Stagemonitor.isStarted()) {
      // don't store the requestId in MDC if stagemonitor is not active
      // so that thread pools that get created on startup don't inherit the requestId
      MDC.put("requestId", requestId);
    }
  }
}
origin: org.stagemonitor/stagemonitor-requestmonitor

private synchronized void getInstanceNameFromExecution(MonitoredRequest<?> monitoredRequest) {
  final MeasurementSession measurementSession = Stagemonitor.getMeasurementSession();
  if (measurementSession.getInstanceName() == null) {
    MeasurementSession session = new MeasurementSession(measurementSession.getApplicationName(), measurementSession.getHostName(),
        monitoredRequest.getInstanceName());
    Stagemonitor.setMeasurementSession(session);
  }
}
origin: org.stagemonitor/stagemonitor-tracing-elasticsearch

@Override
public Tracer getTracer(StagemonitorPlugin.InitArguments initArguments) {
  final B3TextMapCodec b3TextMapCodec = new B3TextMapCodec.Builder().build();
  final JaegerTracer.Builder builder = new JaegerTracer.Builder(
      initArguments.getMeasurementSession().getApplicationName())
      .withReporter(new NoopReporter())
      .withSampler(new ConstSampler(true))
      .registerInjector(B3HeaderFormat.INSTANCE, b3TextMapCodec)
      .registerInjector(Format.Builtin.HTTP_HEADERS, b3TextMapCodec)
      .registerExtractor(Format.Builtin.HTTP_HEADERS, b3TextMapCodec);
  return builder.build();
}
org.stagemonitor.coreMeasurementSessiongetApplicationName

Popular methods of MeasurementSession

  • <init>
  • getHostName
  • getInstanceName
  • asMap
  • getId
  • getStartTimestamp
  • isInitialized
  • getEndTimestamp
  • getStart
  • isNull
  • setEndTimestamp
  • setEndTimestamp

Popular in Java

  • Making http requests using okhttp
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • JFrame (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now