Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Elasticsearch connection string `scope` key has no effect on index names

Abierto
#2,696 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp, elasticsearch
Área
databases

Línea de trabajo

Start with src/Exceptionless.Core/Configuration/ElasticsearchOptions.cs, especially ReadFromConfiguration and ParseConnectionString, then check src/Exceptionless.Core/Jobs/Elastic/DataMigrationJob.cs and the index configuration files named in the issue. Trace how Scope, ScopePrefix, and EnableSnapshotJobs are set for both Elasticsearch configurations. Done when the scope behavior matches the chosen expected outcome and index prefixes use consistent separators.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

ElasticsearchOptions parses a scope key from ConnectionStrings:Elasticsearch, but index names are built from ScopePrefix, which is computed from AppScope before the connection string is parsed. Setting scope= in the Elasticsearch connection string changes nothing.

Where

  • ElasticsearchOptions.ReadFromConfiguration sets Scope = appOptions.AppScope and ScopePrefix from it, then calls ParseConnectionString.
  • ParseConnectionString overwrites Scope from the scope key but never recomputes ScopePrefix.
  • Every index uses ScopePrefix, e.g. EventIndex and the migrations index. Nothing reads ElasticsearchOptions.Scope for the main cluster.
  • The only reader of Scope is DataMigrationJob, for ElasticsearchToMigrate, where it is used as a raw prefix with no - separator (scope=prod gives prodorganizations-v1, while the main cluster's prefix would be prod-).

Steps to reproduce

  1. Run with EX_ConnectionStrings__Elasticsearch=server=http://localhost:9200;scope=test and no EX_AppScope.
  2. List indexes: they are events-v1-*, stacks-v1, organizations-v1, etc., without a test- prefix.

Expected

Either scope in the Elasticsearch connection string prefixes index names the same way AppScope does, or the key is not parsed at all.

Suggested fix

Set ScopePrefix at the end of ParseConnectionString (ScopePrefix = String.IsNullOrEmpty(Scope) ? "" : $"{Scope}-"), so both the main and ElasticsearchToMigrate options get it, and compute the EnableSnapshotJobs default after parsing, since it depends on ScopePrefix. In DataMigrationJob, use ElasticsearchToMigrate.ScopePrefix so both sides use the same - separator. If per-connection scoping isn't wanted, remove the scope parsing for the main connection string and keep it only for ElasticsearchToMigrate.

Lenguaje dominante
C#
Estrellas
2.5k
Forks
508
Merge medio
2 d 17 h
PR fusionados (30 d)
40

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de exceptionless/Exceptionless

Todos los issues de exceptionless/Exceptionless

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.