diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8575e4bb..9ef80cc1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,3 +99,21 @@ jobs: run: bun install - name: Test run: bun test-unit + check-license: + name: Check license headers + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - name: Check license headers + run: | + fail=false + git ls-files '*.ts' '*.js' | while read file ; do + if ! grep -Eq "(Copyright|generated|GENERATED)" <(awk 'NR<=3' "${file}") ; then + echo "license header checking failed: ${file}" + fail=true + fi + done + if [[ "${fail}" == "true" ]] ; then + echo "Some files failed license check" + exit 1 + fi diff --git a/CHANGELOG.md b/CHANGELOG.md index 74bd4a51..41b3c037 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ This release marks our first release under the Prometheus umbrella. - AggregatorRegistry renamed to ClusterRegistry, old name deprecated - chore: update faceoff to 1.1 - perf: Stat aggregation uses similar strategy to collection. 60% faster aggregation +- chore: Add copyright license headers and test ### Added diff --git a/benchmarks/cluster.js b/benchmarks/cluster.js index d2ea4e9c..3678c6ae 100644 --- a/benchmarks/cluster.js +++ b/benchmarks/cluster.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { getLabelCombinations, getLabelNames } = require('./utils/labels'); diff --git a/benchmarks/counter.js b/benchmarks/counter.js index 13b326f7..5e1f6d0d 100644 --- a/benchmarks/counter.js +++ b/benchmarks/counter.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { getLabelNames, labelCombinationFactory } = require('./utils/labels'); diff --git a/benchmarks/gauge.js b/benchmarks/gauge.js index d4c3f4db..eddb7cae 100644 --- a/benchmarks/gauge.js +++ b/benchmarks/gauge.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { getLabelNames, labelCombinationFactory } = require('./utils/labels'); diff --git a/benchmarks/histogram.js b/benchmarks/histogram.js index 1ecc8f54..9e51dcfa 100644 --- a/benchmarks/histogram.js +++ b/benchmarks/histogram.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { getLabelNames, labelCombinationFactory } = require('./utils/labels'); diff --git a/benchmarks/index.js b/benchmarks/index.js index 666e1138..ef05209b 100644 --- a/benchmarks/index.js +++ b/benchmarks/index.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Benchmark = require('faceoff').default; diff --git a/benchmarks/registry.js b/benchmarks/registry.js index d2a364de..c608fb98 100644 --- a/benchmarks/registry.js +++ b/benchmarks/registry.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { getLabelNames, getLabelCombinations } = require('./utils/labels'); diff --git a/benchmarks/summary.js b/benchmarks/summary.js index 69b8f3c3..2c18564d 100644 --- a/benchmarks/summary.js +++ b/benchmarks/summary.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { getLabelNames, labelCombinationFactory } = require('./utils/labels'); diff --git a/benchmarks/util.js b/benchmarks/util.js index 7c08e3b3..a4009e14 100644 --- a/benchmarks/util.js +++ b/benchmarks/util.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Path = require('path'); diff --git a/benchmarks/utils/labels.js b/benchmarks/utils/labels.js index bf0a7ef9..ff4893f1 100644 --- a/benchmarks/utils/labels.js +++ b/benchmarks/utils/labels.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const VALUES = { diff --git a/example/cluster.js b/example/cluster.js index 6ea70d06..2686a27e 100644 --- a/example/cluster.js +++ b/example/cluster.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const cluster = require('cluster'); diff --git a/example/counter.js b/example/counter.js index 257ef2b4..9a08814c 100644 --- a/example/counter.js +++ b/example/counter.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; // Counter diff --git a/example/default-metrics.js b/example/default-metrics.js index 7d2b9494..0ea2e93e 100644 --- a/example/default-metrics.js +++ b/example/default-metrics.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { collectDefaultMetrics, register } = require('..'); diff --git a/example/exemplars.js b/example/exemplars.js index 29f779e7..7f7127ca 100644 --- a/example/exemplars.js +++ b/example/exemplars.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { register, Registry, Counter, Histogram } = require('..'); diff --git a/example/gauge.js b/example/gauge.js index 3b1b1903..fb68700d 100644 --- a/example/gauge.js +++ b/example/gauge.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; // Gauge diff --git a/example/histogram-1.js b/example/histogram-1.js index 0c2b878a..b94e099d 100644 --- a/example/histogram-1.js +++ b/example/histogram-1.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; // Histogram diff --git a/example/histogram-2.js b/example/histogram-2.js index de6be297..6eeddbef 100644 --- a/example/histogram-2.js +++ b/example/histogram-2.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; // Histogram diff --git a/example/histogram-3.js b/example/histogram-3.js index e68858ff..9209d291 100644 --- a/example/histogram-3.js +++ b/example/histogram-3.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; // Histogram diff --git a/example/histogram-4.js b/example/histogram-4.js index 4b6481cb..f2ce75b6 100644 --- a/example/histogram-4.js +++ b/example/histogram-4.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; // Histogram diff --git a/example/histogram-large-memory.js b/example/histogram-large-memory.js index 5ff2976c..4d5e0ebc 100644 --- a/example/histogram-large-memory.js +++ b/example/histogram-large-memory.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const v8 = require('v8'); diff --git a/example/pushgateway.js b/example/pushgateway.js index 6341f9de..79648f66 100644 --- a/example/pushgateway.js +++ b/example/pushgateway.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const client = require('../index'); diff --git a/example/server.js b/example/server.js index a89afe0b..7290008c 100644 --- a/example/server.js +++ b/example/server.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const express = require('express'); diff --git a/example/summary.js b/example/summary.js index 08efcc46..b1af9f99 100644 --- a/example/summary.js +++ b/example/summary.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; // Summary diff --git a/example/worker.js b/example/worker.js index 5a4553f0..2af9ea83 100644 --- a/example/worker.js +++ b/example/worker.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Path = require('path'); diff --git a/index.d.ts b/index.d.ts index 41a55f2c..8c0ebb2c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + // Type definitions for @prometheus/client // Definitions by: Simon Nyberg http://twitter.com/siimon_nyberg diff --git a/index.js b/index.js index dfef5adc..52ca3631 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + /** * Prometheus client * @module Prometheus client diff --git a/lib/bucketGenerators.js b/lib/bucketGenerators.js index a9a487c7..d0b1a5cd 100644 --- a/lib/bucketGenerators.js +++ b/lib/bucketGenerators.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; exports.linearBuckets = (start, width, count) => { diff --git a/lib/cluster.js b/lib/cluster.js index f17c0d6e..697482a3 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; /** diff --git a/lib/counter.js b/lib/counter.js index 5a84c226..7835c8de 100644 --- a/lib/counter.js +++ b/lib/counter.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + /** * Counter metric */ diff --git a/lib/defaultMetrics.js b/lib/defaultMetrics.js index 7d9a148d..9b6da6ee 100644 --- a/lib/defaultMetrics.js +++ b/lib/defaultMetrics.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { isObject } = require('./util'); diff --git a/lib/exemplar.js b/lib/exemplar.js index cb5d6780..137ab610 100644 --- a/lib/exemplar.js +++ b/lib/exemplar.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; /** diff --git a/lib/gauge.js b/lib/gauge.js index a0d17b8f..789f620e 100644 --- a/lib/gauge.js +++ b/lib/gauge.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + /** * Gauge metric */ diff --git a/lib/histogram.js b/lib/histogram.js index 6655ad54..c87852c3 100644 --- a/lib/histogram.js +++ b/lib/histogram.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + /** * Histogram */ diff --git a/lib/metric.js b/lib/metric.js index e33933ad..0c519de0 100644 --- a/lib/metric.js +++ b/lib/metric.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('./registry'); diff --git a/lib/metricAggregators.js b/lib/metricAggregators.js index 8ea05281..6f897c16 100644 --- a/lib/metricAggregators.js +++ b/lib/metricAggregators.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { LabelGrouper } = require('./util'); diff --git a/lib/metrics/eventLoopLag.js b/lib/metrics/eventLoopLag.js index 644f92a3..af5090f8 100644 --- a/lib/metrics/eventLoopLag.js +++ b/lib/metrics/eventLoopLag.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); diff --git a/lib/metrics/gc.js b/lib/metrics/gc.js index 6e1c10b7..3d9b60d7 100644 --- a/lib/metrics/gc.js +++ b/lib/metrics/gc.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Histogram = require('../histogram'); diff --git a/lib/metrics/heapSizeAndUsed.js b/lib/metrics/heapSizeAndUsed.js index ae8a145d..a6e337f2 100644 --- a/lib/metrics/heapSizeAndUsed.js +++ b/lib/metrics/heapSizeAndUsed.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); diff --git a/lib/metrics/heapSpacesSizeAndUsed.js b/lib/metrics/heapSpacesSizeAndUsed.js index 9519a3b2..8c0639d3 100644 --- a/lib/metrics/heapSpacesSizeAndUsed.js +++ b/lib/metrics/heapSpacesSizeAndUsed.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); diff --git a/lib/metrics/helpers/processMetricsHelpers.js b/lib/metrics/helpers/processMetricsHelpers.js index d1f07630..b9214e9d 100644 --- a/lib/metrics/helpers/processMetricsHelpers.js +++ b/lib/metrics/helpers/processMetricsHelpers.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; function aggregateByObjectName(list) { diff --git a/lib/metrics/helpers/safeMemoryUsage.js b/lib/metrics/helpers/safeMemoryUsage.js index 30fad883..eb586515 100644 --- a/lib/metrics/helpers/safeMemoryUsage.js +++ b/lib/metrics/helpers/safeMemoryUsage.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; // process.memoryUsage() can throw on some platforms, see #67 diff --git a/lib/metrics/helpers/safeRss.js b/lib/metrics/helpers/safeRss.js index 6b1ac2c5..dcd35ebd 100644 --- a/lib/metrics/helpers/safeRss.js +++ b/lib/metrics/helpers/safeRss.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; // process.memoryUsage.rss() can throw on some platforms, see #67 diff --git a/lib/metrics/osMemoryHeap.js b/lib/metrics/osMemoryHeap.js index 24ace2a9..1d05695b 100644 --- a/lib/metrics/osMemoryHeap.js +++ b/lib/metrics/osMemoryHeap.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); diff --git a/lib/metrics/osMemoryHeapLinux.js b/lib/metrics/osMemoryHeapLinux.js index 955c4cf3..4bdabc45 100644 --- a/lib/metrics/osMemoryHeapLinux.js +++ b/lib/metrics/osMemoryHeapLinux.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); diff --git a/lib/metrics/processCpuTotal.js b/lib/metrics/processCpuTotal.js index d0213094..a4671828 100644 --- a/lib/metrics/processCpuTotal.js +++ b/lib/metrics/processCpuTotal.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const OtelApi = require('@opentelemetry/api'); diff --git a/lib/metrics/processHandles.js b/lib/metrics/processHandles.js index 9a78d9f8..2996e5e0 100644 --- a/lib/metrics/processHandles.js +++ b/lib/metrics/processHandles.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { aggregateByObjectName } = require('./helpers/processMetricsHelpers'); diff --git a/lib/metrics/processMaxFileDescriptors.js b/lib/metrics/processMaxFileDescriptors.js index f71a85a7..81cfe777 100644 --- a/lib/metrics/processMaxFileDescriptors.js +++ b/lib/metrics/processMaxFileDescriptors.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); diff --git a/lib/metrics/processOpenFileDescriptors.js b/lib/metrics/processOpenFileDescriptors.js index 547a8e3a..6569c7d9 100644 --- a/lib/metrics/processOpenFileDescriptors.js +++ b/lib/metrics/processOpenFileDescriptors.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); diff --git a/lib/metrics/processRequests.js b/lib/metrics/processRequests.js index 2351f71d..3e2a41cf 100644 --- a/lib/metrics/processRequests.js +++ b/lib/metrics/processRequests.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); const { aggregateByObjectName } = require('./helpers/processMetricsHelpers'); diff --git a/lib/metrics/processResources.js b/lib/metrics/processResources.js index 5e50d98b..7975cfbd 100644 --- a/lib/metrics/processResources.js +++ b/lib/metrics/processResources.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); const { updateMetrics } = require('./helpers/processMetricsHelpers'); diff --git a/lib/metrics/processStartTime.js b/lib/metrics/processStartTime.js index d20018d3..35dd08ee 100644 --- a/lib/metrics/processStartTime.js +++ b/lib/metrics/processStartTime.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); diff --git a/lib/metrics/version.js b/lib/metrics/version.js index 7eabf9a5..98f5bf9b 100644 --- a/lib/metrics/version.js +++ b/lib/metrics/version.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Gauge = require('../gauge'); diff --git a/lib/pushgateway.js b/lib/pushgateway.js index 9b1261be..f43487b4 100644 --- a/lib/pushgateway.js +++ b/lib/pushgateway.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const http = require('http'); diff --git a/lib/registry.js b/lib/registry.js index 4d0906b1..9c9aeaf7 100644 --- a/lib/registry.js +++ b/lib/registry.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { getValueAsString, Grouper } = require('./util'); diff --git a/lib/summary.js b/lib/summary.js index 556e047c..94a14748 100644 --- a/lib/summary.js +++ b/lib/summary.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + /** * Summary */ diff --git a/lib/timeWindowQuantiles.js b/lib/timeWindowQuantiles.js index 176cb5b8..357e7dfd 100644 --- a/lib/timeWindowQuantiles.js +++ b/lib/timeWindowQuantiles.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { TDigest } = require('tdigest'); diff --git a/lib/util.js b/lib/util.js index 8b0ded20..18dca108 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const util = require('util'); diff --git a/lib/validation.js b/lib/validation.js index 2472c000..ade09c69 100644 --- a/lib/validation.js +++ b/lib/validation.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const util = require('util'); diff --git a/lib/worker.js b/lib/worker.js index 8eb83971..48c1409f 100644 --- a/lib/worker.js +++ b/lib/worker.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; /** diff --git a/test/aggregatorsTest.js b/test/aggregatorsTest.js index 0010a656..35ea65db 100644 --- a/test/aggregatorsTest.js +++ b/test/aggregatorsTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; describe('aggregators', () => { diff --git a/test/browserCompatibilityTest.js b/test/browserCompatibilityTest.js index c6e2a779..7e8d0940 100644 --- a/test/browserCompatibilityTest.js +++ b/test/browserCompatibilityTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; describe('Browser compatibility', () => { diff --git a/test/bucketGeneratorsTest.js b/test/bucketGeneratorsTest.js index c54d68ed..add1de57 100644 --- a/test/bucketGeneratorsTest.js +++ b/test/bucketGeneratorsTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; describe('bucketGenerators', () => { diff --git a/test/clusterTest.js b/test/clusterTest.js index e6b89def..bd2141bc 100644 --- a/test/clusterTest.js +++ b/test/clusterTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const cluster = require('cluster'); diff --git a/test/counterTest.js b/test/counterTest.js index 0ee0fc2d..7fcf5a35 100644 --- a/test/counterTest.js +++ b/test/counterTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../index').Registry; diff --git a/test/defaultMetricsTest.js b/test/defaultMetricsTest.js index 2021d799..ff41e70f 100644 --- a/test/defaultMetricsTest.js +++ b/test/defaultMetricsTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../index').Registry; diff --git a/test/exemplarsTest.js b/test/exemplarsTest.js index f573d810..0ad65883 100644 --- a/test/exemplarsTest.js +++ b/test/exemplarsTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../index').Registry; diff --git a/test/gaugeTest.js b/test/gaugeTest.js index c90df1ae..1eb1b5e0 100644 --- a/test/gaugeTest.js +++ b/test/gaugeTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { Metric } = require('../lib/metric'); diff --git a/test/histogramTest.js b/test/histogramTest.js index 5ec89f97..6d44253b 100644 --- a/test/histogramTest.js +++ b/test/histogramTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../index').Registry; diff --git a/test/metrics/eventLoopLagTest.js b/test/metrics/eventLoopLagTest.js index 7c347bb0..8b992ee2 100644 --- a/test/metrics/eventLoopLagTest.js +++ b/test/metrics/eventLoopLagTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../../index').Registry; diff --git a/test/metrics/gcTest.js b/test/metrics/gcTest.js index d5ecb469..e7fa89cf 100644 --- a/test/metrics/gcTest.js +++ b/test/metrics/gcTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../../index').Registry; diff --git a/test/metrics/heapSizeAndUsedTest.js b/test/metrics/heapSizeAndUsedTest.js index 3c917ed6..73e2e6f8 100644 --- a/test/metrics/heapSizeAndUsedTest.js +++ b/test/metrics/heapSizeAndUsedTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../../index').Registry; diff --git a/test/metrics/heapSpacesSizeAndUsedTest.js b/test/metrics/heapSpacesSizeAndUsedTest.js index c4c06ce7..73553370 100644 --- a/test/metrics/heapSpacesSizeAndUsedTest.js +++ b/test/metrics/heapSpacesSizeAndUsedTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../../index').Registry; diff --git a/test/metrics/maxFileDescriptorsTest.js b/test/metrics/maxFileDescriptorsTest.js index 3921b871..221003fd 100644 --- a/test/metrics/maxFileDescriptorsTest.js +++ b/test/metrics/maxFileDescriptorsTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const exec = require('child_process').execSync; diff --git a/test/metrics/processHandlesTest.js b/test/metrics/processHandlesTest.js index dd03404c..69f764c4 100644 --- a/test/metrics/processHandlesTest.js +++ b/test/metrics/processHandlesTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../../index').Registry; diff --git a/test/metrics/processOpenFileDescriptorsTest.js b/test/metrics/processOpenFileDescriptorsTest.js index 7cc6c50b..36fca8f8 100644 --- a/test/metrics/processOpenFileDescriptorsTest.js +++ b/test/metrics/processOpenFileDescriptorsTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../../index').Registry; diff --git a/test/metrics/processRequestsTest.js b/test/metrics/processRequestsTest.js index c28a51d2..eecdb81d 100644 --- a/test/metrics/processRequestsTest.js +++ b/test/metrics/processRequestsTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../../index').Registry; diff --git a/test/metrics/processResourcesTest.js b/test/metrics/processResourcesTest.js index dd13dedc..7917649b 100644 --- a/test/metrics/processResourcesTest.js +++ b/test/metrics/processResourcesTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; describe('processRequests', () => { diff --git a/test/metrics/processStartTimeTest.js b/test/metrics/processStartTimeTest.js index bee5cdab..4468db79 100644 --- a/test/metrics/processStartTimeTest.js +++ b/test/metrics/processStartTimeTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../../index').Registry; diff --git a/test/metrics/versionTest.js b/test/metrics/versionTest.js index 0a28fb0e..0f2cbc4e 100644 --- a/test/metrics/versionTest.js +++ b/test/metrics/versionTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../../index').Registry; diff --git a/test/pushgatewayTest.js b/test/pushgatewayTest.js index 812b1199..3001613d 100644 --- a/test/pushgatewayTest.js +++ b/test/pushgatewayTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const nock = require('nock'); diff --git a/test/pushgatewayWithPathTest.js b/test/pushgatewayWithPathTest.js index 7dd75427..081f79d1 100644 --- a/test/pushgatewayWithPathTest.js +++ b/test/pushgatewayWithPathTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const pushGatewayPath = '/path'; diff --git a/test/registerTest.js b/test/registerTest.js index ed2c8c24..ce4a8757 100644 --- a/test/registerTest.js +++ b/test/registerTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../index').Registry; diff --git a/test/summaryTest.js b/test/summaryTest.js index 306c9b8b..30cfe1cb 100644 --- a/test/summaryTest.js +++ b/test/summaryTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const Registry = require('../index').Registry; diff --git a/test/timeWindowQuantilesTest.js b/test/timeWindowQuantilesTest.js index cda7c181..8adc9bd1 100644 --- a/test/timeWindowQuantilesTest.js +++ b/test/timeWindowQuantilesTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; describe('timeWindowQuantiles', () => { diff --git a/test/typescript.ts b/test/typescript.ts index 13840a38..80d899ce 100644 --- a/test/typescript.ts +++ b/test/typescript.ts @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + import { Counter, Pushgateway, Registry } from '../index'; const registry = new Registry(); diff --git a/test/utilTest.js b/test/utilTest.js index 0eae56d9..c1fe8ebc 100644 --- a/test/utilTest.js +++ b/test/utilTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; describe('utils', () => { diff --git a/test/validationTest.js b/test/validationTest.js index 27bb97f6..8b94a69b 100644 --- a/test/validationTest.js +++ b/test/validationTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; describe('validation', () => { diff --git a/test/workerTest.js b/test/workerTest.js index eb043c0a..9f28d467 100644 --- a/test/workerTest.js +++ b/test/workerTest.js @@ -1,3 +1,17 @@ +// Copyright The Prometheus 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. + 'use strict'; const { EventEmitter } = require('events');