MCPcopy
hub / github.com/grafana/tempo / ToTempopb

Method ToTempopb

tempodb/backend/block_meta.go:304–332  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

302}
303
304func (dcs DedicatedColumns) ToTempopb() ([]*tempopb.DedicatedColumn, error) {
305 tempopbCols := make([]*tempopb.DedicatedColumn, 0, len(dcs))
306
307 for _, c := range dcs {
308 scope, err := c.Scope.ToTempopb()
309 if err != nil {
310 return nil, fmt.Errorf("unable to convert dedicated column '%s': %w", c.Name, err)
311 }
312
313 typ, err := c.Type.ToTempopb()
314 if err != nil {
315 return nil, fmt.Errorf("unable to convert dedicated column '%s': %w", c.Name, err)
316 }
317
318 options, err := c.Options.ToTempopb()
319 if err != nil {
320 return nil, fmt.Errorf("unable to convert dedicated column '%s': %w", c.Name, err)
321 }
322
323 tempopbCols = append(tempopbCols, &tempopb.DedicatedColumn{
324 Scope: scope,
325 Name: c.Name,
326 Type: typ,
327 Options: options,
328 })
329 }
330
331 return tempopbCols, nil
332}
333
334func (dcs DedicatedColumns) Validate() (warnings []error, err error) {
335 columnCount := map[DedicatedColumnType]map[DedicatedColumnScope]int{}

Callers 3

dedicatedColsToJSONFunction · 0.45

Calls

no outgoing calls

Tested by 2

dedicatedColsToJSONFunction · 0.36