github.com/siglens/siglens@v0.0.0-20240328180423-f7ce9ae441ed/pkg/instrumentation/sscounters.go (about) 1 /* 2 Copyright 2023. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package instrumentation 18 19 import ( 20 "go.opentelemetry.io/otel/metric" 21 ) 22 23 /* 24 TO DO - 25 1. Handle errors when creating new metrics 26 */ 27 28 var POST_REQUESTS_COUNT, _ = meter.Int64Counter( 29 "ss.post.requests.count", 30 metric.WithUnit("1"), 31 metric.WithDescription("Counts post requests received")) 32 33 var QUERY_COUNT, _ = meter.Int64Counter( 34 "ss.query.count", 35 metric.WithUnit("1"), 36 metric.WithDescription("query counts")) 37 38 var SEGFILE_ROTATE_COUNT, _ = meter.Int64Counter( 39 "ss.segfile.rotate.count", 40 metric.WithUnit("1"), 41 metric.WithDescription("segment rotation count")) 42 43 var WIP_BUFFER_FLUSH_COUNT, _ = meter.Int64Counter( 44 "ss.wip.buffer.flush.count", 45 metric.WithUnit("1"), 46 metric.WithDescription("wip flush count")) 47 48 var S3_UPLOADS, _ = meter.Int64Counter( 49 "ss.s3uploads.received", 50 metric.WithUnit("1"), 51 metric.WithDescription("s3 uploads received")) 52 53 var S3_DOWNLOADS, _ = meter.Int64Counter( 54 "ss.s3downloads.received", 55 metric.WithUnit("1"), 56 metric.WithDescription("s3 downloads received")) 57 58 var S3_DELETED, _ = meter.Int64Counter( 59 "ss.s3deleted.received", 60 metric.WithUnit("1"), 61 metric.WithDescription("s3 deletes received"))