Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HA Proxy] Add dimension fields for stat datastream #7323

Merged
merged 7 commits into from Oct 18, 2023

Conversation

agithomas
Copy link
Contributor

@agithomas agithomas commented Aug 9, 2023

  • Enhancement

What does this PR do?

Add dimension fields for the stats datastream as part of TSDB enablement.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • Index template verification
  • Index settings verification

How to test this PR locally

  • elastic-package build
  • elastic-package install
  • Document count verification

Related issues

@elasticmachine
Copy link

elasticmachine commented Aug 9, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-10-12T11:37:26.183+0000

  • Duration: 16 min 6 sec

Test stats 🧪

Test Results
Failed 0
Passed 40
Skipped 0
Total 40

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Aug 9, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (1/1) 💚
Classes 100.0% (1/1) 💚
Methods 90.476% (19/21)
Lines 97.312% (181/186)
Conditionals 100.0% (0/0) 💚

@botelastic
Copy link

botelastic bot commented Sep 8, 2023

Hi! We just realized that we haven't looked into this PR in a while. We're sorry! We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1. Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Sep 8, 2023
@agithomas agithomas mentioned this pull request Sep 12, 2023
20 tasks
@botelastic
Copy link

botelastic bot commented Oct 8, 2023

Hi! This PR has been stale for a while and we're going to close it as part of our cleanup procedure. We appreciate your contribution and would like to apologize if we have not been able to review it, due to the current heavy load of the team. Feel free to re-open this PR if you think it should stay open and is worth rebasing. Thank you for your contribution!

@botelastic botelastic bot closed this Oct 8, 2023
@agithomas agithomas reopened this Oct 8, 2023
@botelastic botelastic bot removed the Stalled label Oct 8, 2023
@agithomas agithomas marked this pull request as ready for review October 12, 2023 12:25
@agithomas agithomas requested a review from a team as a code owner October 12, 2023 12:25
@agithomas
Copy link
Contributor Author

Timeseries enablement verification
      "time_series": {
        "end_time": "2023-10-12T14:32:19.000Z",
        "start_time": "2023-10-12T05:07:02.000Z"
      },
      "provided_name": ".ds-metrics-haproxy.stat-default-2023.10.12-000002",
Mapping verification
{
  "mappings": {
    "_meta": {
      "managed_by": "fleet",
      "managed": true,
      "package": {
        "name": "haproxy"
      }
    },
    "_data_stream_timestamp": {
      "enabled": true
    },
    "dynamic_templates": [
      {
        "container.labels": {
          "path_match": "container.labels.*",
          "match_mapping_type": "string",
          "mapping": {
            "type": "keyword"
          }
        }
      },
      {
        "strings_as_keyword": {
          "match_mapping_type": "string",
          "mapping": {
            "ignore_above": 1024,
            "type": "keyword"
          }
        }
      }
    ],
    "date_detection": false,
    "properties": {
      "@timestamp": {
        "type": "date"
      },
      "agent": {
        "properties": {
          "ephemeral_id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "id": {
            "type": "keyword",
            "time_series_dimension": true
          },
          "name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "type": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "cloud": {
        "properties": {
          "account": {
            "properties": {
              "id": {
                "type": "keyword",
                "time_series_dimension": true
              }
            }
          },
          "availability_zone": {
            "type": "keyword",
            "time_series_dimension": true
          },
          "image": {
            "properties": {
              "id": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "instance": {
            "properties": {
              "id": {
                "type": "keyword",
                "time_series_dimension": true
              },
              "name": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "machine": {
            "properties": {
              "type": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "project": {
            "properties": {
              "id": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "provider": {
            "type": "keyword",
            "time_series_dimension": true
          },
          "region": {
            "type": "keyword",
            "time_series_dimension": true
          },
          "service": {
            "properties": {
              "name": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          }
        }
      },
      "container": {
        "properties": {
          "id": {
            "type": "keyword",
            "time_series_dimension": true
          },
          "image": {
            "properties": {
              "name": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "name": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "data_stream": {
        "properties": {
          "dataset": {
            "type": "constant_keyword",
            "value": "haproxy.stat"
          },
          "namespace": {
            "type": "constant_keyword",
            "value": "default"
          },
          "type": {
            "type": "constant_keyword",
            "value": "metrics"
          }
        }
      },
      "ecs": {
        "properties": {
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "elastic_agent": {
        "properties": {
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "snapshot": {
            "type": "boolean"
          },
          "version": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "event": {
        "properties": {
          "agent_id_status": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "dataset": {
            "type": "constant_keyword",
            "value": "haproxy.stat"
          },
          "duration": {
            "type": "long"
          },
          "ingested": {
            "type": "date",
            "format": "strict_date_time_no_millis||strict_date_optional_time||epoch_millis"
          },
          "module": {
            "type": "constant_keyword",
            "value": "haproxy"
          }
        }
      },
      "haproxy": {
        "properties": {
          "stat": {
            "properties": {
              "agent": {
                "properties": {
                  "check": {
                    "properties": {
                      "description": {
                        "type": "keyword",
                        "ignore_above": 1024
                      },
                      "fall": {
                        "type": "long"
                      },
                      "health": {
                        "type": "long"
                      },
                      "rise": {
                        "type": "long"
                      }
                    }
                  },
                  "code": {
                    "type": "long"
                  },
                  "description": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "duration": {
                    "type": "long"
                  },
                  "fall": {
                    "type": "long"
                  },
                  "health": {
                    "type": "long"
                  },
                  "rise": {
                    "type": "long"
                  },
                  "status": {
                    "type": "keyword",
                    "ignore_above": 1024
                  }
                }
              },
              "check": {
                "properties": {
                  "agent": {
                    "properties": {
                      "last": {
                        "type": "long"
                      }
                    }
                  },
                  "code": {
                    "type": "long"
                  },
                  "down": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "duration": {
                    "type": "long",
                    "time_series_metric": "gauge"
                  },
                  "failed": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "health": {
                    "properties": {
                      "fail": {
                        "type": "long"
                      },
                      "last": {
                        "type": "keyword",
                        "ignore_above": 1024
                      }
                    }
                  },
                  "status": {
                    "type": "keyword",
                    "ignore_above": 1024
                  }
                }
              },
              "client": {
                "properties": {
                  "aborted": {
                    "type": "long",
                    "time_series_metric": "counter"
                  }
                }
              },
              "component_type": {
                "type": "long",
                "time_series_dimension": true
              },
              "compressor": {
                "properties": {
                  "bypassed": {
                    "properties": {
                      "bytes": {
                        "type": "long",
                        "time_series_metric": "counter"
                      }
                    }
                  },
                  "in": {
                    "properties": {
                      "bytes": {
                        "type": "long",
                        "time_series_metric": "counter"
                      }
                    }
                  },
                  "out": {
                    "properties": {
                      "bytes": {
                        "type": "long",
                        "time_series_metric": "counter"
                      }
                    }
                  },
                  "response": {
                    "properties": {
                      "bytes": {
                        "type": "long",
                        "time_series_metric": "counter"
                      }
                    }
                  }
                }
              },
              "connection": {
                "properties": {
                  "attempt": {
                    "properties": {
                      "total": {
                        "type": "long",
                        "time_series_metric": "counter"
                      }
                    }
                  },
                  "cache": {
                    "properties": {
                      "hits": {
                        "type": "long",
                        "time_series_metric": "counter"
                      },
                      "lookup": {
                        "properties": {
                          "total": {
                            "type": "long",
                            "time_series_metric": "counter"
                          }
                        }
                      }
                    }
                  },
                  "idle": {
                    "properties": {
                      "limit": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      },
                      "total": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      }
                    }
                  },
                  "rate": {
                    "type": "long",
                    "time_series_metric": "gauge"
                  },
                  "rate_max": {
                    "type": "long",
                    "time_series_metric": "gauge"
                  },
                  "retried": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "reuse": {
                    "properties": {
                      "total": {
                        "type": "long",
                        "time_series_metric": "counter"
                      }
                    }
                  },
                  "time": {
                    "properties": {
                      "avg": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      }
                    }
                  },
                  "total": {
                    "type": "long",
                    "time_series_metric": "counter"
                  }
                }
              },
              "cookie": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "downtime": {
                "type": "long",
                "time_series_metric": "counter"
              },
              "header": {
                "properties": {
                  "rewrite": {
                    "properties": {
                      "failed": {
                        "properties": {
                          "total": {
                            "type": "long",
                            "time_series_metric": "counter"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "in": {
                "properties": {
                  "bytes": {
                    "type": "long",
                    "time_series_metric": "counter"
                  }
                }
              },
              "last_change": {
                "type": "long",
                "time_series_metric": "gauge"
              },
              "load_balancing_algorithm": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "out": {
                "properties": {
                  "bytes": {
                    "type": "long",
                    "time_series_metric": "counter"
                  }
                }
              },
              "proxy": {
                "properties": {
                  "id": {
                    "type": "long",
                    "time_series_dimension": true
                  },
                  "mode": {
                    "type": "keyword",
                    "ignore_above": 1024
                  },
                  "name": {
                    "type": "keyword",
                    "ignore_above": 1024
                  }
                }
              },
              "queue": {
                "properties": {
                  "limit": {
                    "type": "long"
                  },
                  "time": {
                    "properties": {
                      "avg": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      }
                    }
                  }
                }
              },
              "request": {
                "properties": {
                  "connection": {
                    "properties": {
                      "errors": {
                        "type": "long",
                        "time_series_metric": "counter"
                      }
                    }
                  },
                  "denied": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "denied_by_connection_rules": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "denied_by_session_rules": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "errors": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "intercepted": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "queued": {
                    "properties": {
                      "current": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      },
                      "max": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      }
                    }
                  },
                  "rate": {
                    "properties": {
                      "max": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      },
                      "value": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      }
                    }
                  },
                  "redispatched": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "total": {
                    "type": "long",
                    "time_series_metric": "counter"
                  }
                }
              },
              "response": {
                "properties": {
                  "denied": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "errors": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "http": {
                    "properties": {
                      "1xx": {
                        "type": "long",
                        "time_series_metric": "counter"
                      },
                      "2xx": {
                        "type": "long",
                        "time_series_metric": "counter"
                      },
                      "3xx": {
                        "type": "long",
                        "time_series_metric": "counter"
                      },
                      "4xx": {
                        "type": "long",
                        "time_series_metric": "counter"
                      },
                      "5xx": {
                        "type": "long",
                        "time_series_metric": "counter"
                      },
                      "other": {
                        "type": "long",
                        "time_series_metric": "counter"
                      }
                    }
                  },
                  "time": {
                    "properties": {
                      "avg": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      }
                    }
                  }
                }
              },
              "selected": {
                "properties": {
                  "total": {
                    "type": "long",
                    "time_series_metric": "counter"
                  }
                }
              },
              "server": {
                "properties": {
                  "aborted": {
                    "type": "long",
                    "time_series_metric": "counter"
                  },
                  "active": {
                    "type": "long",
                    "time_series_metric": "gauge"
                  },
                  "backup": {
                    "type": "long",
                    "time_series_metric": "gauge"
                  },
                  "id": {
                    "type": "long",
                    "time_series_dimension": true
                  }
                }
              },
              "service_name": {
                "type": "keyword",
                "time_series_dimension": true
              },
              "session": {
                "properties": {
                  "current": {
                    "type": "long",
                    "time_series_metric": "gauge"
                  },
                  "limit": {
                    "type": "long",
                    "time_series_metric": "gauge"
                  },
                  "max": {
                    "type": "long",
                    "time_series_metric": "gauge"
                  },
                  "rate": {
                    "properties": {
                      "limit": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      },
                      "max": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      },
                      "value": {
                        "type": "long",
                        "time_series_metric": "gauge"
                      }
                    }
                  },
                  "total": {
                    "type": "long",
                    "time_series_metric": "counter"
                  }
                }
              },
              "source": {
                "properties": {
                  "address": {
                    "type": "keyword",
                    "time_series_dimension": true
                  }
                }
              },
              "status": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "throttle": {
                "properties": {
                  "pct": {
                    "type": "scaled_float",
                    "scaling_factor": 1000,
                    "time_series_metric": "gauge"
                  }
                }
              },
              "tracked": {
                "properties": {
                  "id": {
                    "type": "long"
                  }
                }
              },
              "weight": {
                "type": "long",
                "time_series_metric": "gauge"
              }
            }
          }
        }
      },
      "host": {
        "properties": {
          "architecture": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "containerized": {
            "type": "boolean"
          },
          "domain": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "hostname": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "id": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "ip": {
            "type": "ip"
          },
          "mac": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "name": {
            "type": "keyword",
            "time_series_dimension": true
          },
          "os": {
            "properties": {
              "build": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "codename": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "family": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "kernel": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "name": {
                "type": "keyword",
                "ignore_above": 1024,
                "fields": {
                  "text": {
                    "type": "text"
                  }
                }
              },
              "platform": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "type": {
                "type": "keyword",
                "ignore_above": 1024
              },
              "version": {
                "type": "keyword",
                "ignore_above": 1024
              }
            }
          },
          "type": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      },
      "metricset": {
        "properties": {
          "name": {
            "type": "keyword",
            "ignore_above": 1024
          },
          "period": {
            "type": "long"
          }
        }
      },
      "process": {
        "properties": {
          "pid": {
            "type": "long",
            "time_series_dimension": true
          }
        }
      },
      "service": {
        "properties": {
          "address": {
            "type": "keyword",
            "time_series_dimension": true
          },
          "type": {
            "type": "keyword",
            "ignore_above": 1024
          }
        }
      }
    }
  }
}


@agithomas
Copy link
Contributor Author

Index rollover testing
GET _index_template/metrics-haproxy.stat

PUT _index_template/metrics-haproxy.stat
{
      "index_patterns": [
        "metrics-haproxy.stat-*"
      ],
      "template": {
        "settings": {
          "index": {
            "mode": null
          }
        }
    },
    "composed_of": [
      "metrics-haproxy.stat@package",
      "metrics-haproxy.stat@custom",
      ".fleet_globals-1",
      ".fleet_agent_id_verification-1"
    ],
    "priority": 200,
    "data_stream": {
      "hidden": false,
      "allow_custom_routing": false
    }
}


POST metrics-haproxy.stat-default/_rollover

{
  "acknowledged": true,
  "shards_acknowledged": true,
  "old_index": ".ds-metrics-haproxy.stat-default-2023.10.12-000002",
  "new_index": ".ds-metrics-haproxy.stat-default-2023.10.12-000003",
  "rolled_over": true,
  "dry_run": false,
  "conditions": {}
}

@agithomas
Copy link
Contributor Author

Dashboard issues are fixed here - #8204

Copy link
Contributor

@ritalwar ritalwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@agithomas agithomas merged commit 683d9a2 into elastic:main Oct 18, 2023
4 checks passed
@elasticmachine
Copy link

Package haproxy - 1.8.5 containing this change is available at https://epr.elastic.co/search?package=haproxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants