/**
 * Copyright (c) 2020-present, Goldman Sachs
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { AbstractPlugin, type AbstractPluginManager } from '../application/AbstractPluginManager.js';
import type { PlainObject } from '../CommonUtils.js';
export interface TraceData {
    name: string;
    tags?: PlainObject;
}
export declare enum CORE_TRACER_TAG {
    USER = "user",
    ENV = "env",
    RESULT = "result",
    ERROR = "error",
    HTTP_STATUS = "status",
    HTTP_REQUEST_METHOD = "method",
    HTTP_REQUEST_URL = "url"
}
export interface TracerServicePluginManager extends AbstractPluginManager {
    getTracerServicePlugins(): TracerServicePlugin<unknown>[];
    registerTracerServicePlugin(plugin: TracerServicePlugin<unknown>): void;
}
export interface TracerServicePluginInfo {
    serviceName: string;
    url: string;
}
export declare abstract class TracerServicePlugin<T> extends AbstractPlugin {
    install(pluginManager: TracerServicePluginManager): void;
    abstract bootstrap(clientSpan: T | undefined, response: Response): void;
    abstract createClientSpan(traceData: TraceData, method: string, url: string, headers: PlainObject): T;
    abstract concludeClientSpan(clientSpan: T | undefined, error: Error | undefined): void;
}
interface TraceEntry<T> {
    clientSpan: T;
    plugin: TracerServicePlugin<T>;
}
export declare class Trace {
    traceEntries: TraceEntry<unknown>[];
    setup(traceEntries: TraceEntry<unknown>[]): void;
    bootstrap(response: Response): void;
    reportSuccess(): void;
    reportError(error: Error): void;
}
export declare class TracerService {
    private plugins;
    registerPlugins(plugins: TracerServicePlugin<unknown>[]): void;
    createTrace(traceData: TraceData | undefined, method: string, url: string, headers: PlainObject): Trace;
}
export {};
//# sourceMappingURL=TracerService.d.ts.map