Skip to content

Commit a51597a

Browse files
authored
database_observability: add more supporting information to error logs in Postgres schema_details collector (#4895)
1 parent 35d1f1c commit a51597a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/component/database_observability/postgres/collector/schema_details.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ func (c *SchemaDetails) extractSchemas(ctx context.Context, dbName string, dbCon
482482
}
483483

484484
if err := rs.Err(); err != nil {
485-
return fmt.Errorf("failed to iterate over tables result set for database %s: %w", dbName, err)
485+
return fmt.Errorf("failed to iterate over tables result set for database %q schema %q: %w", dbName, schemaName, err)
486486
}
487487
}
488488

@@ -507,7 +507,7 @@ func (c *SchemaDetails) extractSchemas(ctx context.Context, dbName string, dbCon
507507
if !cacheHit {
508508
table, err = c.fetchTableDefinitions(ctx, table, dbConnection)
509509
if err != nil {
510-
level.Error(c.logger).Log("msg", "failed to get table definitions", "datname", dbName, "schema", table.schema, "err", err)
510+
level.Error(c.logger).Log("msg", "failed to get table definitions", "datname", dbName, "schema", table.schema, "table", table.tableName, "err", err)
511511
continue
512512
}
513513
if c.cache != nil {

0 commit comments

Comments
 (0)