This commit is contained in:
		
							
								
								
									
										4
									
								
								vendor/github.com/prometheus/common/expfmt/fuzz.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/prometheus/common/expfmt/fuzz.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -21,8 +21,8 @@ import "bytes" | ||||
|  | ||||
| // Fuzz text metric parser with with github.com/dvyukov/go-fuzz: | ||||
| // | ||||
| //     go-fuzz-build github.com/prometheus/common/expfmt | ||||
| //     go-fuzz -bin expfmt-fuzz.zip -workdir fuzz | ||||
| //	go-fuzz-build github.com/prometheus/common/expfmt | ||||
| //	go-fuzz -bin expfmt-fuzz.zip -workdir fuzz | ||||
| // | ||||
| // Further input samples should go in the folder fuzz/corpus. | ||||
| func Fuzz(in []byte) int { | ||||
|   | ||||
							
								
								
									
										22
									
								
								vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								vendor/github.com/prometheus/common/expfmt/openmetrics_create.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -46,20 +46,20 @@ import ( | ||||
| // missing features and peculiarities to avoid complications when switching from | ||||
| // Prometheus to OpenMetrics or vice versa: | ||||
| // | ||||
| // - Counters are expected to have the `_total` suffix in their metric name. In | ||||
| //   the output, the suffix will be truncated from the `# TYPE` and `# HELP` | ||||
| //   line. A counter with a missing `_total` suffix is not an error. However, | ||||
| //   its type will be set to `unknown` in that case to avoid invalid OpenMetrics | ||||
| //   output. | ||||
| //   - Counters are expected to have the `_total` suffix in their metric name. In | ||||
| //     the output, the suffix will be truncated from the `# TYPE` and `# HELP` | ||||
| //     line. A counter with a missing `_total` suffix is not an error. However, | ||||
| //     its type will be set to `unknown` in that case to avoid invalid OpenMetrics | ||||
| //     output. | ||||
| // | ||||
| // - No support for the following (optional) features: `# UNIT` line, `_created` | ||||
| //   line, info type, stateset type, gaugehistogram type. | ||||
| //   - No support for the following (optional) features: `# UNIT` line, `_created` | ||||
| //     line, info type, stateset type, gaugehistogram type. | ||||
| // | ||||
| // - The size of exemplar labels is not checked (i.e. it's possible to create | ||||
| //   exemplars that are larger than allowed by the OpenMetrics specification). | ||||
| //   - The size of exemplar labels is not checked (i.e. it's possible to create | ||||
| //     exemplars that are larger than allowed by the OpenMetrics specification). | ||||
| // | ||||
| // - The value of Counters is not checked. (OpenMetrics doesn't allow counters | ||||
| //   with a `NaN` value.) | ||||
| //   - The value of Counters is not checked. (OpenMetrics doesn't allow counters | ||||
| //     with a `NaN` value.) | ||||
| func MetricFamilyToOpenMetrics(out io.Writer, in *dto.MetricFamily) (written int, err error) { | ||||
| 	name := in.GetName() | ||||
| 	if name == "" { | ||||
|   | ||||
							
								
								
									
										3
									
								
								vendor/github.com/prometheus/common/expfmt/text_create.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								vendor/github.com/prometheus/common/expfmt/text_create.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -17,7 +17,6 @@ import ( | ||||
| 	"bufio" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
| 	"io/ioutil" | ||||
| 	"math" | ||||
| 	"strconv" | ||||
| 	"strings" | ||||
| @@ -44,7 +43,7 @@ const ( | ||||
| var ( | ||||
| 	bufPool = sync.Pool{ | ||||
| 		New: func() interface{} { | ||||
| 			return bufio.NewWriter(ioutil.Discard) | ||||
| 			return bufio.NewWriter(io.Discard) | ||||
| 		}, | ||||
| 	} | ||||
| 	numBufPool = sync.Pool{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user