Skip to content

Commit

Permalink
make configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
alextheimer committed Mar 21, 2024
1 parent b8559a3 commit f27d6b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/src/main/resources/filodb-defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,9 @@ filodb {
# These labels will be dropped from every exported row.
drop-labels = ["_ws_", "drop-label1"]

# default label value to export when an expected dynamic column does not exist
default-dynamic-column-value = "none"

# Each row's labels are compared against all rule-group keys. If a match is found,
# the row's labels are compared *sequentially* against each of the group's rules until
# a rule meets both of the following criteria:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ case class BatchExporter(downsamplerSettings: DownsamplerSettings, userStartTime
// append all dynamic column values
exportTableConfig.labelColumnMapping.foreach { pair =>
val labelValue = exportData.labels.get(pair._1)
dataSeq.append(labelValue.getOrElse(""))
dataSeq.append(labelValue.getOrElse(downsamplerSettings.exportDefaultDynamicColumnValue))
}
// append all fixed column values
dataSeq.append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ class DownsamplerSettings(conf: Config = ConfigFactory.empty()) extends Serializ

@transient lazy val exportDropLabels = downsamplerConfig.as[Seq[String]]("data-export.drop-labels")

@transient lazy val exportDefaultDynamicColumnValue =
downsamplerConfig.as[String]("data-export.default-dynamic-column-value")

@transient lazy val exportKeyToRules = {
val keyRulesPairs = downsamplerConfig.as[Seq[Config]]("data-export.groups").map { group =>
val key = group.as[Seq[String]]("key")
Expand Down

0 comments on commit f27d6b6

Please sign in to comment.