content: /*
   * Copyright The OpenTelemetry Authors
   * SPDX-License-Identifier: Apache-2.0
   */
  
  package io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.server;
  
  import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
  import io.opentelemetry.javaagent.bootstrap.internal.JavaagentHttpServerInstrumenters;
  import io.opentelemetry.javaagent.instrumentation.pekkohttp.v1_0.PekkoHttpUtil;
  import org.apache.pekko.http.scaladsl.model.HttpRequest;
  import org.apache.pekko.http.scaladsl.model.HttpResponse;
  
  public final class PekkoHttpServerSingletons {
  
    private static final Instrumenter<HttpRequest, HttpResponse> INSTRUMENTER;
  
    static {
      INSTRUMENTER =
          JavaagentHttpServerInstrumenters.create(
              PekkoHttpUtil.instrumentationName(),
              new PekkoHttpServerAttributesGetter(),
              PekkoHttpServerHeaders.INSTANCE);
    }
  
    public static Instrumenter<HttpRequest, HttpResponse> instrumenter() {
      return INSTRUMENTER;
    }
  
    public static HttpResponse errorResponse() {
      return (HttpResponse) HttpResponse.create().withStatus(500);
    }
  
    private PekkoHttpServerSingletons() {}
  }
  