Skip to content

Commit

Permalink
Add Prometheus Exporter: Step 0 - Update MetricsExporter Interface (#240
Browse files Browse the repository at this point in the history
)
  • Loading branch information
erichsueh3 authored Aug 21, 2020
1 parent 021bd5e commit 1ce011f
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions sdk/include/opentelemetry/sdk/metrics/exporter.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright The OpenTelemetry Authors
*
* 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.
*/

#pragma once

#include <memory>
Expand All @@ -22,7 +38,17 @@ enum class ExportResult
* Exporting failed. The caller must not retry exporting the same batch; the
* batch must be dropped.
*/
kFailure
kFailure = 1,

/**
* The collection does not have enough space to receive the export batch.
*/
kFailureFull = 2,

/**
* The export() function was passed an invalid argument.
*/
kFailureInvalidArgument = 3,
};
/**
* MetricsExporter defines the interface that protocol-specific span exporters must
Expand All @@ -39,12 +65,6 @@ class MetricsExporter
* @param records a vector of unique pointers to metric records
*/
virtual ExportResult Export(const std::vector<Record> &records) noexcept = 0;

/**
* In the Metrics specification, there is no Shutdown function required for exporters
* The Shutdown function can be implemented within exporters that wish to have one,
* but will not be enforced through this header
*/
};
} // namespace metrics
} // namespace sdk
Expand Down

0 comments on commit 1ce011f

Please sign in to comment.